Skip to content

Invalid Context after useState #226

Discussion options

You must be logged in to vote

Hi. Each re-render results into the execution of the function component. This means that the unityContext keeps being recreated. You can either create create it outside of your component, or within a "componentDidMount" cycle using a useEffect without any dependencies. I hope this helps you! Happy coding.

Replies: 1 comment 1 reply

Comment options

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

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