0.2.0 • Published 30 days ago

airx-router v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
30 days ago

router npm build status

Front-end routing for airx

Use

import * as airx from 'airx'
import { RouteComponentProps, Router } from 'airx-router'

function TestRouteComponent(props: RouteComponentProps) {
  // Matching child routes will be rendered here
  return () => props.children
}

const route = {
  path: '/root',
  component: TestRouteComponent,
  children: [
    {
      path: '/',
      redirect: 'child-1'
    },
    {
      path: 'child-1',
      component: TestRouteComponent,
      children: [
        {
          path: '/',
          redirect: 'child-2'
        },
        {
          path: 'child-2',
          component: TestRouteComponent
        }
      ]
    }
  ]
}

airx
  .createApp(<Router routes={[route]} />)
  .mount(document.getElementById('app'))
0.2.0

30 days ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

11 months ago