Socket
Socket
Sign inDemoInstall

navigation-react

Package Overview
Dependencies
4
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    navigation-react

React plugin for the Navigation router


Version published
Weekly downloads
140
increased by25%
Maintainers
1
Install size
19.7 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 25 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc