Menu

1 / 2

useNavigate in React

DEV Community·PRIYA K·6 months ago
#pVo9sebq
#frontend#javascript#react#webdev#navigate
Reading 0:00
15s threshold

ReactJS useNavigate() Hook - GeeksforGeeks

Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.

geeksforgeeks.org

Is a React Hook that gives access to the navigate object.

we can't pass navigate object directly as a props to the component,don't want to pass it in deeply child

Is a Standard way to programmatically change routes within a functional component,Replacing the deprecated useHistory Hook

Returns a function that navigate programmatically in browser in response to user interaction or effect

Returns the current Navigation action which describes how the router came to the current Location, either by a pop, push, or replace on the History stack.

to navigate between different pages in your app.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.