Bard mobx router

Bard mobx router

  • Github

›React UI Components

About Bard router

  • Philosophy
  • Getting started

Router and routes

  • Route specific hooks
  • Router hooks

React UI Components

  • <Route/>
  • <Link/>

Plugins

  • Scroll plugin
  • Window title plugin
  • Html5 history plugin

How to's

  • How-to's / FAQ

<Route/> component

Route are simple UI switches that either render or not the corresponding UI component depending on the router state.

It takes two arguments: path and Component, any other prop set on Route will be passed to Component.

If router state matches the path, Component is displayed.

Route component example

import React from 'react'
import {Route} from 'bard-router'
import MyComponent from './MyComponent'

// MyComponent will render only if router state
// - matches `/private/my-things`
// - or, matches a deeper path `/private/my-things/details`

export default function SomeComponentWithRoute() {
  return (
    <div>
      <Route path="/private/my-things" Component={MyComponent} thingID={1} />
    </div>
  )
}
← Router hooks<Link/> →
Bard mobx router
Docs
Getting Started
Community
Who is using this?Chat on Gitter
More
GitHub
Copyright © 2023 Aodev