2018/9/2現在
React Native Navigation (V2) by Wix — Getting Started
Installing - React Native Navigation v2 - truly native navigation for iOS and Android
install
npm install --save react-native-navigation@alpha
すごく分かりにくいが、XCodeで設定をがんばってやる
Installing - React Native Navigation v2 - truly native navigation for iOS and Android
Link Binary With Libraries section add libReactNativeNavigation.a
はすごく分かりにくい。+を押してからlibReactNativeNavigation.a
をAddする
index.js
import { Navigation } from "react-native-navigation";
import App from './App';
Navigation.registerComponent(`navigation.playground.WelcomeScreen`, () => App);
Navigation.events().registerAppLaunchedListener(() => {
Navigation.setRoot({
root: {
component: {
name: "navigation.playground.WelcomeScreen"
}
}
});
});
これで実行
何も変わってないように見えるが、実はちゃんとNavigationされて表示されている。