useDisclosure: TS Types are possibly undefined
See original GitHub issueDescribe 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:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve just fixed that as well
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.