1.3.1 • Published 11 months ago

another-react-router v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months 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

11 months ago

1.3.0

11 months ago

1.2.5

12 months ago

1.2.4

12 months ago

1.2.3

12 months ago

1.2.2

12 months ago

1.2.1

12 months ago

1.2.0

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago