React URL changes but view does not change

Viewed 35

I'm using node version 14.20.0 & npm version 6.14.17

I'm importing link like this import { Link } from "react-router-dom"; and use it like this <Link to="/"><LocalConvenienceStoreRoundedIcon className="header__logo" /></Link>

I'm trying to redirect the user to HOME page when user click on icon name as (LocalConvenienceStoreRoundedIcon). The URL in the browser changes but view is not changing. Page remains the same. Adding exact path is also NOT WORKINGHere in the image check the url it says checkout but the page is still home. This is my app.js [This is my Header.js.]

1 Answers

Bugfix was merged into v5.3.3. Update to react-router-dom@5.3.3 or higher.

From the project's root directory run:

  1. npm uninstall -S react-router-dom
  2. npm install -S react-router-dom@5.3.3 (or @latest)
Related