Skip to content

Commit e95d4cd

Browse files
committed
formatted
1 parent 8e9c434 commit e95d4cd

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ export default App;
137137
| `app/blog/[slug]/loader.jsx` | Data loader for `/blog/:slug` |
138138
| `app/loading.jsx` | Loading UI while data is fetched |
139139

140-
141-
142140
## 🪝 useAppRouter Hook
143141

144142
You can now use the useAppRouter() hook to get a JSON structure of all matched routes. This is useful when you want to inspect or manipulate the route config manually — for example, inside a custom RouterProvider or createBrowserRouter setup.
@@ -153,7 +151,6 @@ const MyComponent = () => {
153151
};
154152
```
155153

156-
157154
## 🪝 useNextParams Hook
158155

159156
The `useNextParams` hook lets you easily access dynamic route parameters (like `[slug]`, `[...slug]`) in your components. recommended for use in pages that have dynamic segments instead of using `useParams` from React Router.
@@ -182,7 +179,6 @@ import { Link, useNavigate, useLocation } from "react-next-router";
182179

183180
This keeps your dependencies simple and ensures full compatibility.
184181

185-
186182
## 🏗️ Route Grouping (like Next.js `(group)` folders)
187183

188184
Folders wrapped in parentheses will not affect the URL path:

src/app/blog/[id]/loader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { LoaderFunctionArgs } from "react-router-dom";
22
const FetchLoad = async ({ params }: LoaderFunctionArgs) => {
33
const data = await fetch(
4-
`https://jsonplaceholder.typicode.com/todos/${params.id}`
4+
`https://jsonplaceholder.typicode.com/todos/${params.id}`,
55
);
66
const json = await data.json();
77
console.log(json);

0 commit comments

Comments
 (0)