Skip to content

Any issue with not using isOpen prop on dialog? #816

Answered by kylemh
kylemh asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for asking. This is clearly answered in the docs:

If you'd rather not have the dialog always rendered, you can put a guard in front of it and only render when it should be open. In this case you don’t need the isOpen prop at all.

Note, however, that the dialog will not render to the DOM when isOpen={false}, but you may want to save on the number of elements created in your render function. You should probably do this when your dialog contains a lot of elements.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kylemh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant