Skip to content

Sometimes correct quiz results are not being rendered (Blocked Updates) #2

@DivyanshBatham

Description

@DivyanshBatham

Generally, React Router and Redux work just fine together. Occasionally though, an app can have a component that doesn’t update when the location changes (child routes or active nav links don’t update).This happens if:
The component is connected to redux via connect()(Comp).
The component is not a “route component”, meaning it is not rendered like so:
The problem is that Redux implements shouldComponentUpdate and there’s no indication that anything has changed if it isn’t receiving props from the router. This is straightforward to fix. Find where you connect your component and wrap it in withRouter.// before
export default connect(mapStateToProps)(Something)

https://reacttraining.com/react-router/web/guides/redux-integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions