Skip to content

Commit 6196484

Browse files
committed
Update doc
1 parent 76d89e5 commit 6196484

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

JSR.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,30 @@ export default function MyApp({ Component, pageProps }) {
7171
}
7272
```
7373

74+
### Usage with React, Vite React or any other React based component
75+
76+
For rendering add `<NextTopLoader />` to your `return()` inside the <Router><Router/> component in `App()`:
77+
78+
```js
79+
import NextTopLoader from 'nextjs-toploader';
80+
const App = () => {
81+
return (
82+
<div>
83+
<Router>
84+
<NextTopLoader color='red' showSpinner={false} />
85+
<Routes>
86+
<Route path="/" element={<Home />} />
87+
<Route path="/about" element={<About />} />
88+
<Route path="*" element={<NotFound/>} />
89+
</Routes>
90+
</Router>
91+
</div>
92+
)
93+
}
94+
95+
export default App;
96+
```
97+
7498
### Default Configuration
7599

76100
If no props are passed to `<NextTopLoader />`, below is the default configuration applied.

0 commit comments

Comments
 (0)