Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In V4 router events don't seem to propagate into redux connected components #4753

Closed
gdenisov opened this issue Mar 14, 2017 · 1 comment

Comments

2 participants
@gdenisov
Copy link

commented Mar 14, 2017

Version

4.0.0

Test Case

import React from 'react'
import {
  BrowserRouter as Router,
  Route,
  Link,
  NavLink
} from 'react-router-dom'
import { connect } from 'react-redux'

class Nav extends React.Component {
  render() {
    return (
      <ul>
        <li><NavLink exact to="/" activeClassName="is-selected">Home</NavLink></li>
        <li><NavLink to="/about" activeClassName="is-selected">About</NavLink></li>
        <li><NavLink to="/topics" activeClassName="is-selected">Topics</NavLink></li>
      </ul>
    );
  }
}

var ConnectedNav = connect((state) => {
  return {};
})(Nav);

const BasicExample = () => (
  <Router>
    <div>
      <ConnectedNav />
    </div>
  </Router>
)

export default BasicExample;

Steps to reproduce

Expected Behavior

activeClassName should be applied to current NavLinks

Actual Behavior

As you navigate around nothing activeClassName is not applied, isActive method is not called, etc.

@mjackson

This comment has been minimized.

Copy link
Member

commented Mar 14, 2017

Please see our guide to dealing with blocked updates. Also, react-redux v5 is going to stop blocking updates using shouldComponentUpdate, AFAICT.

@mjackson mjackson closed this Mar 14, 2017

ReySun added a commit to ReySun/webpack-typescript-react that referenced this issue Jan 29, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.