我是新來做出反應的,我遵循關於整合在React Native Docs中打開的現有應用程序的教程。React Native:與現有應用程序集成
private ReactRootView mReactRootView;
.......
Bundle launchOptions = new Bundle();
launchOptions.putBoolean("test", true);
//mReactRootView.startReactApplication(mReactInstanceManager, "ThirdAwesomeComponent", launchOptions);
mReactRootView.startReactApplication(mReactInstanceManager, "ThirdAwesomeComponent", null); // Actual example
有沒有辦法在index.android.js
閱讀了HelloWorld組件launchOptions?
另外我有兩個活動,我需要調用react native守護進程,並且想呈現服務器返回的兩個不同的佈局。
我如何能做到這一點,因爲目前我只有一個:
我怎樣才能改變服務器的詳細信息,如從Android原生應用主機和端口號,同時呼籲 mReactRootView.startReactApplication(mReactInstanceManager,「ThirdAwesomeComponent」,launchOptions); 例如,我想改變端口爲8899和主機服務器。 – Shash
你是說網絡服務器還是本地節點服務器?本地服務器可以改變使用http://stackoverflow.com/questions/34431052/react-native-change-listening-port我猜。我很不清楚你的服務器變化。提供更多關於您準確實施的信息的方便性? –