Skip to content

Navigating programatically between routes and some tweaks in useNavig…#113

Merged
arvish-codal merged 1 commit intomainfrom
12_June
Jun 11, 2024
Merged

Navigating programatically between routes and some tweaks in useNavig…#113
arvish-codal merged 1 commit intomainfrom
12_June

Conversation

@arvish-codal
Copy link
Copy Markdown
Owner

@arvish-codal arvish-codal commented Jun 11, 2024

…ate Hook

To summarize, React Router provides the useNavigate hook to navigate programmatically. Call the hook within the component and use the
returned function to navigate passing in either a path (i.e 'order-summary') or a number (i.e (-1) in our example) that indicates a change
in the history stack.

If you want to replace the history, pass in the optional second argument with replace set to true.

Refer here to understand about STACK data structure --> https://www.techgig.com/practice/data-structure/stacks/tutorial#:~:text=Initially%20the%20stack%20is%20empty,the%20stack%20is%20completely%20full

@arvish-codal arvish-codal merged commit baaf161 into main Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants