Created
August 3, 2024 09:12
-
-
Save jubayer-webdev/248bfdc0bbbc32dbe8147326dd074cdd to your computer and use it in GitHub Desktop.
const location = useLocation(); <Navigate to="/login" state={{ fromJame: location }} replace />; the key for state object can be any name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "hash": "", | |
| "key": "default" | |
| "pathname": "/hss", | |
| "search": "", | |
| "state": null, | |
| } | |
| { | |
| "hash": "", | |
| "key": "tynn5346" | |
| "pathname": "/login", | |
| "search": "", | |
| "state": { | |
| "fromJame": { | |
| "hash": "", | |
| "key": "default" | |
| "pathname": "/hss", | |
| "search": "", | |
| "state": null, | |
| } | |
| }, | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Important
state key can be any name.