navigation-react
TypeScript icon, indicating that this package has built-in type declarations

4.8.0 • Public • Published

Hello World

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>  
);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.5.1-rsc.30rsc
4.8.024latest

Version History

VersionDownloads (Last 7 Days)Published
4.8.024
4.7.02
4.6.10
4.6.010
4.5.1-rsc.30
4.5.1-rsc.20
4.5.1-rsc.11
4.5.1-rsc.00
4.5.156
4.5.02
4.4.00
4.3.01
4.2.02
4.1.13
4.1.02
4.0.11
4.0.02
3.1.00
3.0.01
2.0.512
2.0.40
2.0.30
2.0.20
2.0.10
2.0.00
1.2.03
1.1.00
1.0.00

Package Sidebar

Install

npm i navigation-react

Weekly Downloads

122

Version

4.8.0

License

Apache-2.0

Unpacked Size

81.2 kB

Total Files

45

Last publish

Collaborators

  • grahammendick