I am trying to integrate React Native into an existing iOS app, where we want to utilise some of our existing logic in React Native. I have successfully implemented a Turbo Module using the new architecture documentation.
However I cannot see if it is possible to share some data from my native iOS apps main app module to the turbo module. A contrived use case using the RTNCalculator in the guide as an example would be to pass string from the app’s AppDelegate.swift to the RTNCalculator.mm object to use later. Is there a good way of doing this? Can I access the instance of RTNCalculator.mm used by React Native in the native side of my application to inject a dependency somehow?
The only way I have managed to do this so far is to have a class variable on the RTNCalculator exposed in the header file, which the AppDelegate can import and set a value to, but this seems quite cumbersome.