Created
October 16, 2018 12:36
-
-
Save broerjuang/5b265750d8993a0716b849b629aa42eb to your computer and use it in GitHub Desktop.
Experimentation with Navigation
Second Screen
include Navigation.Impl;
let component = ReasonReact.statelessComponent("FirstRoute");
let make = (~navigation, _children) => {
...component,
render: _self =>
BsReactNative.(
<View>
<TouchableOpacity onPress={navigateTo(~navigation, ~to_=`First)}>
<Text value="Go to first route" />
</TouchableOpacity>
</View>
),
};
let default =
ReasonReact.wrapReasonForJs(~component, jsProps =>
make(~navigation=jsProps->navigationGet, [||])
);
routes.js
// @flow
import {createStackNavigator} from 'react-navigation';
import App from './lib/js/src/First.bs';
import Second from './lib/js/src/Second.bs';
export default createStackNavigator({
First: App,
Second: Second,
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First Screen