import { StateNavigator } from 'navigation';
import { NavigationHandler, NavigationContext } from 'navigation-react';
import { NavigationStack,. Scene } from 'navigation-react-native';
const stateNavigator = new StateNavigator([
{ key: 'hello' },
{ key: 'world', trackCrumbTrail: true },
]);
const Hello = () => {
const { stateNavigator } = useContext(NavigationContext);
return (
<Button
title="Hello"
onPress={() => {
stateNavigator.navigate('world', { size: 20 });
}} />
);
};
const World = () => {
const { data } = useContext(NavigationContext);
return <Text style={{ fontSize: data.size }}>World</Text>;
};
const App = () => (
<NavigationHandler stateNavigator={stateNavigator}>
<NavigationStack>
<Scene stateKey="hello"><Hello /></Scene>
<Scene stateKey="world"><World /></Scene>
</NavigationStack>
</NavigationHandler>
);
navigation-react-native
9.31.1 • Public • Published Versions
Current Tags
Version | Downloads (Last 7 Days) | Tag |
---|---|---|
8.10.0-wip.0 | 0 | wip |
9.31.1 | 14 | latest |
Version History
Package Sidebar
Install
npm i navigation-react-native
Repository
Weekly Downloads
192
Version
9.31.1
License
Apache-2.0
Unpacked Size
1.23 MB
Total Files
340