Skip to content

Conversation

@clement-lta
Copy link
Owner

add a function to produce the default value of useDisclosure hook.

In the old implementation, we pass the boolean value. If I pass:

const { isOpen, onOpen } = useDisclosure(getInitialValue())

Then the getInitialValue will be called every re-render. So to avoid this, I will prevent this by accept an initial function

@clement-lta clement-lta added the enhancement New feature or request label Apr 16, 2025
@clement-lta clement-lta self-assigned this Apr 16, 2025
@clement-lta clement-lta merged commit 634b01d into main Apr 16, 2025
1 check passed
@clement-lta clement-lta deleted the feature/add-initial-fn-for-disclosure branch April 16, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants