Skip to content

Can't send data to Unity from React app with unityContext.send #242

Discussion options

You must be logged in to vote

Hi. You should create your Unity Context model outside of your functional component, or place it within a mount cycle using UseEffect. Because in your example the Unity Context is recreated each render which results in the Unity Context losing its reference to the Unity Instance. See the documentation for further instructions and examples.

Replies: 4 comments 3 replies

Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by jeffreylanters
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #239 on September 21, 2021 07:57.