react-baker

1.0.3 • Public • Published

React Baker

Dead simple breadcrumbs for React Router 4 or anything really

import { Breadcrumb, PathViewer } from 'react-baker'

const MyComponent = props => (
  <div>
    <Breadcrumb name='Home' path='/' {/* use any props you want */} />
    <Switch>
      <Route {/* ... */} />
      <Route {/* ... */} />
      <Route {/* ... */} />
    </Switch>
  </div>
)

const App = props => (
  <div>
    <PathViewer render={({name, path }) => (
      <a href={path}>{name} /</a>
    )} />
    <Router>
      <Switch>
        <Route exact path='/' component={MyComponent} />
      </Switch>
    </Router>
  </div>
)

Example

$ cd example
$ yarn
$ yarn start

Readme

Keywords

none

Package Sidebar

Install

npm i react-baker

Weekly Downloads

1

Version

1.0.3

License

none

Last publish

Collaborators

  • ccutch