import { StateNavigator } from 'navigation';
import { NavigationHandler, NavigationLink, NavigationContext, SceneView } from 'navigation-react';
const stateNavigator = new StateNavigator([
{ key: 'hello', route: '' },
{ key: 'world' }
]);
stateNavigator.start();
const Hello = () => (
<NavigationLink
stateKey="world"
navigationData={{ size: 20 }}>
Hello
</NavigationLink>
);
const World = () => {
const { data } = useContext(NavigationContext);
return (
<div style={{ fontSize: data.size }}>World</div>
);
};
const App = () => (
<NavigationHandler stateNavigator={stateNavigator}>
<SceneView active="hello"><Hello /></SceneView>
<SceneView active="world"><World /></SceneView>
</NavigationHandler>
);
navigation-react
4.8.0 • Public • Published Versions
Current Tags
Version | Downloads (Last 7 Days) | Tag |
---|---|---|
4.5.1-rsc.3 | 0 | rsc |
4.8.0 | 24 | latest |
Version History
Version | Downloads (Last 7 Days) | Published |
---|---|---|
4.8.0 | 24 | |
4.7.0 | 2 | |
4.6.1 | 0 | |
4.6.0 | 10 | |
4.5.1-rsc.3 | 0 | |
4.5.1-rsc.2 | 0 | |
4.5.1-rsc.1 | 1 | |
4.5.1-rsc.0 | 0 | |
4.5.1 | 56 | |
4.5.0 | 2 | |
4.4.0 | 0 | |
4.3.0 | 1 | |
4.2.0 | 2 | |
4.1.1 | 3 | |
4.1.0 | 2 | |
4.0.1 | 1 | |
4.0.0 | 2 | |
3.1.0 | 0 | |
3.0.0 | 1 | |
2.0.5 | 12 | |
2.0.4 | 0 | |
2.0.3 | 0 | |
2.0.2 | 0 | |
2.0.1 | 0 | |
2.0.0 | 0 | |
1.2.0 | 3 | |
1.1.0 | 0 | |
1.0.0 | 0 |
Package Sidebar
Install
npm i navigation-react
Repository
Weekly Downloads
122
Version
4.8.0
License
Apache-2.0
Unpacked Size
81.2 kB
Total Files
45