Mark As Completed Discussion

In React Router, programmatic navigation refers to the ability to navigate to a specific route programmatically, without relying on user actions like clicking on a link or typing in the address bar.

Programmatic navigation can be achieved using the history object or the withRouter higher-order component (HOC).

With the history object, you can use the push method to navigate to a specific URL. For example, to navigate to the '/about' route, you can use the following code:

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment