Skip to content

How to use react-modal from testing-library/react test #1027

Answered by diasbruno
jsoneaday asked this question in Q&A
Discussion options

You must be logged in to vote

@jsoneaday when you call setAppElement before the render the #root element is not available yet.

In this case, appElement={el} will be recommended, or, you will need to prepare the document.body to have the correct elements, before rendering.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@diasbruno
Comment options

Answer selected by jsoneaday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants