As a fun side-project, I got Unity and React Native working besides each other on Android. In case you want to have native elements on top of your Unity game, this could be something (but probably not worth the dependency hell..). It's a one button click to create a build and it should be easy to extend the Unity or React Native projects. Most time was spend on getting all of the dependencies to work together. I initially wanted to make the React Native code part of the Unity build through an exported .aar with gradle. But it turned out to be a lot simpler to export the Unity project as a gradle project, and rather include in the React Native gradle build. No. 1 reason for this was the extra control that came from building through gradle, such as avoiding 64 bit libraries being included. Feel free to build further on it and let me know what you think https://github.com/marijnz/unity-react
@marijnz I have a question. In a react native app you typically have a <TextInput> and you type in some text. but when you click back to the home screen then click back on the app the text is still there. Is there any way to reset the state back to original as soon as you tap the app icon? I heard componentDidLoad() is being deprecated. Thanks in advance.
I didn't measure. I didn't see this as a thing as the overhead of having native elements should be very small. Hey, that's a very specific thing that I don't know of. You can just attach some callback to the app getting opened/brought to the foreground and clear the data? Not sure if I get your qustion.
Hey thanks for the reply, sorry if it is not quite related to react and unity. But here's the thing. I've deployed / built an app to ios. I put data inside a text field, when I click off the app and somewhere on the home screen, but then go back into the app, that text is still there in the field. How would you reset all data inside an app, regardless of how many components there are. Appreciate the reply, just I don't know the answer?
OC I've seen this. https://facebook.github.io/react-native/docs/appstate but this https://reactjs.org/docs/react-component.html say it is due to become deprecated??
@marijnz what are you thoughts about 'react-navigation' vs 'react-native-navigation' -> rolled out by wix. I'm about to roll out a navigation system but would appreciate your feedback if you have experience in the two options so I can pick the most suitable option.
I have an issue with 2018 and 2019, which I reproduced here - https://github.com/yurykorzun/unity-react-native-demo It looks like yoga layout engine doesn't work for some reason. Works fine with 2017