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

4.13.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.13.056latest

Version History

VersionDownloads (Last 7 Days)Published
4.13.056
4.12.01
4.11.02
4.10.02
4.9.04
4.8.08
4.7.02
4.6.11
4.6.01
4.5.1-rsc.30
4.5.1-rsc.20
4.5.1-rsc.10
4.5.1-rsc.00
4.5.189
4.5.02
4.4.01
4.3.03
4.2.01
4.1.11
4.1.01
4.0.11
4.0.01
3.1.01
3.0.01
2.0.524
2.0.41
2.0.31
2.0.21
2.0.11
2.0.01
1.2.03
1.1.01
1.0.01

Package Sidebar

Install

npm i navigation-react

Weekly Downloads

150

Version

4.13.0

License

Apache-2.0

Unpacked Size

84.8 kB

Total Files

51

Last publish

Collaborators

  • grahammendick