Socket
Socket
Sign inDemoInstall

react-browser-router

Package Overview
Dependencies
20
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-browser-router

A Router wrapper for react-router, it allows you to create multiple Routers sharing the same history.


Version published
Maintainers
1
Install size
17.4 kB
Created

Readme

Source

A Router wrapper for react-router, it allows you to create multiple Routers sharing the same history.

Install

npm install --save react-browser-router

Example

import React, { Component } from "react";
import { render } from "react-dom";
import { 
    BrowserRouter, 
    Route, 
    Link
} from "react-browser-router";
import Home from "./components/Home";
import About from "./components/About";
import Nav from "./components/Nav";

class NavComponent extends Component {
    render() {
        return (<BrowserRouter>
            <div>
                <Nav />
            </div>
        </BrowserRouter>);
    }
}

class ViewComponent extends Component {
    render() {
        return (<BrowserRouter>
            <div>
                <Link to="/">Home</Link>
                <Link to="/about">About</Link>

                <Route path="/" component={Home} />
                <Route path="/about" render=(props) => (<About {...props} />) />
            </div>
        </BrowserRouter>);
    }
}

render(<ViewComponent />, viewElement);
render(<NavComponent />, navElement);

Keywords

FAQs

Last updated on 26 Jun 2018

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