Giter Site home page Giter Site logo

Comments (5)

DevJett avatar DevJett commented on June 10, 2024 2

This because activeClassName is updating outside of redux.

You can accomplish that by setting pure to false

export default connect(mapStateToProps, null , null, { pure: false })(App)

Note that this will make your application less performant, so only do this if you have no other option

Or you can use withRouter from react-router-dom

import { withRouter } from 'react-router-dom';
export default withRouter(connect(mapStateToProps, matchDispatchToProps)(App));

from alumni-network.

bonham000 avatar bonham000 commented on June 10, 2024

Yeah this thing sucks I just spent a while working on trying to make it function correctly.

If you click the home route in the Nav and then re-click any other route they seem to highlight correctly.

from alumni-network.

no-stack-dub-sack avatar no-stack-dub-sack commented on June 10, 2024

If you click the home route in the Nav and then re-click any other route they seem to highlight correctly.

Well how dumb is that! Ughh...

Here's a few articles that seem to take up similar issues:

from alumni-network.

no-stack-dub-sack avatar no-stack-dub-sack commented on June 10, 2024

RESOLVED

By wrapping NavBar in Route component

from alumni-network.

etiennejcharles avatar etiennejcharles commented on June 10, 2024

If anyone comes across this post - I suggest you read this, you need to pass down the location object, in order to force an update when your component is connected to redux.

https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/guides/blocked-updates.md#the-solution

from alumni-network.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.