question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useDisclosure: TS Types are possibly undefined

See original GitHub issue

Describe the bug The values returned from the useDisclosure hook are possible undefined, meaning i have to accommodate for this all over the place

Expected Behavior

isOpen: boolean
onClose: () => void
onOpen: () => void

To Reproduce Inspect the useDisclosure types

Suggested solution(s) Make not undefined 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
segunadebayocommented, Dec 3, 2019

I’ve just fixed that as well

1reaction
segunadebayocommented, Dec 3, 2019

Ah. I see. Thanks for that observation

I merged a PR that fixed this. I’ve just released an update that fixes this. Kindly upgrade.

If this issue persists, I’ll re-open this issue.

Cheers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Object is possibly 'undefined'." in TypeScript - Stack Overflow
The error happens because control flow analysis is difficult, especially when the information you want to keep track of cannot be ...
Read more >
3 Simple Ways To Fix Object Is Possibly Undefined In TypeScript
This video explains how to fix "object is possibly undefined or null" in TypeScript.Object is possibly null in TypeScript: ...
Read more >
useDisclosure - Chakra UI
useDisclosure is a custom hook used to help handle common open , close , or toggle scenarios. It can be used to control...
Read more >
Functional on the frontend with fp-ts and pipe - Meeshkan
Descriptive errors - When we see logs in the console, it's rarely Uncaught TypeError: Cannot Read Property 'name' of undefined or Object doesn't ......
Read more >
Menu - Vision UI Dashboard - Creative Tim
Without this, the MenuList will render in an undefined position. ... Open the menu, try and type any letter, (say "S") to see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found