1.3.1 • Published 1 year ago

another-react-router v1.3.1

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

Another react router

Another react router is a npm package, that allowes developers and users comfortable route between pages on their web applications built with react library.

Installation

npm install another-react-router
(bun/yarn/pnpm) add another-react-router

Getting started

Create directory where all of your routes will be located

for example:

[
  "src": [
    "routes": [
      "page.tsx"
    ]
  ],
]

Create a file with name page.tsx and add the following code:

// ./src/routes/page.tsx

export default function Page() {
  return <div>Hello another react router!</div>
}

Then run our cli to initialize router

npx arr init

Create RouterProvider component for your app

for example:

// ./src/components/providers/router-provider.tsx
import { AnotherReactRouterProvider } from "another-react-router"
import { routes } from "../../../another-react-router.config.ts"

export const RouterProvider = () => (
  <AnotherReactRouterProvider routes={routes} />
)

Add RouterProvider to your app

// ./src/app.tsx
import { RouterProvider } from "@/components/providers/router-provider.tsx"

export const App = () => <RouterProvider />

Now your app is ready to go!

Documentation

See more informations on https://another-react-router.vercel.app/

1.3.1

1 year ago

1.3.0

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago