Skip to content

Commit 89bb3f2

Browse files
authored
Update useNavigate example (#14616)
1 parent c069b4e commit 89bb3f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/api/hooks/useNavigate.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ navigate("/some/route?search=param");
7878
All properties are optional.
7979

8080
```tsx
81-
navigate({
82-
pathname: "/some/route",
83-
search: "?search=param",
84-
hash: "#hash",
85-
state: { some: "state" },
86-
});
81+
navigate(
82+
{
83+
pathname: "/some/route",
84+
search: "?search=param",
85+
hash: "#hash",
86+
},
87+
{ state: { some: "state" } }
88+
);
8789
```
8890

8991
If you use `state`, that will be available on the [`Location`](https://api.reactrouter.com/v7/interfaces/react_router.Location.html) object on

0 commit comments

Comments
 (0)