1.0.4 • Published 1 year ago

@izumisy/react-nanorouter v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

react-nanorouter

react-nanorouter npm version MIT License

Terribly simple router for React

Example

Only useRouter function is available.

import { useRouter } from 'react-nanorouter'
import { ProductsPage } from './pages/products'
import { UsersPage } from './pages/users'

function App() {
  const [history, router] = useRouter({
    '/products': (history) => <ProductsPage />,
    '/users': (history) => <UsersPage />,
  })

  return (
    <>{router}</>
  )
}

Contributions

PRs accepted

LICENSE

MIT

1.0.2

1 year ago

1.0.1

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.0

4 years ago