<Link>useNavigate
Using Link
<Link> is a built-in component that renders an HTML <a> tag. It allows users navigate to another page by clicking or tapping on it. It is the primary way to navigate between routes in Hana.
Link Props
to- The path to navigate to. This can be a string or an object.replace- Iftrue, clicking the link will replace the current entry in the history stack instead of adding a new one.state- Thestateproperty can be used to set a stateful value for the new location which is stored inside history state. This value can subsequently be accessed viauseLocation()
/next-path page, you can access the state value like this:
<Link> component, check out the base React Router documentation.
Using navigation hooks
TheuseNavigate hook is used to navigate to a new location. It is the programmatic way to navigate between routes.
Hook options
Thenavigate function accepts a route string as its first argument and an options object as its second argument.
replace- Iftrue, the current entry in the history stack will be replaced instead of adding a new one.state- Thestateproperty can be used to set a stateful value for the new location which is stored inside history state. This value can subsequently be accessed viauseLocation().
useNavigate hook in the base React Router documentation
Search Params
TheuseSearchParams hook is used to access the query string parameters of the current location. It returns an array containing an object with the query string parameters and a function to update the query string parameters

