Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

router1-react

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

router1-react

React components to use with router1

  • 0.9.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Router1 React

React components to use https://github.com/zxbodya/router1 library in react js application.

RouterContext

Used to pass router context variable into components when rendering.

can be used as following:


// router - router1 instance
// renderApp - function that will render your app virtual dom
 
ReactDOM.render(
  <RouterContext.Provider value={router}>
    ...
  </RouterContext.Provider>,
  appElement
);

Used to generate links with router1, will handle user clicks and can highlight active links.

<Link route="contact" activeClassName="active" params={{routeParam: "value"}}>Contact</Link>

Also you can pass additional state data(to be used later when handling route change) using optional data param:

<Link
  route="contact"
  activeClassName="active"
  params={{routeParam: "value"}}
  state={{ noscroll: true }}
>
  Contact
</Link>

ActivateWrap

Similar to Link it can be used to highlight some block when route is active.

For example, when you need to add active class to li instead of link:

<ActivateWrap route="contact" activeClassName="active" params={{routeParam: "value"}} component="li">
  <Link route="contact" params={{routeParam: "value"}}>Contact</Link>
</ActivateWrap>

Example

See router1-app-template

Keywords

FAQs

Package last updated on 13 Mar 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc