Skip to content

Extraenous setPath() calls on RouterMixin.componentWillReceiveProps #177

@STRML

Description

@STRML

If your router is in the main app's path, and that app rerenders on a path change (not uncommon), even if that path isn't passed to the router, it will rerender which causes it to send a path from the environment.

It should be safe to only listen to explicit path changes:

 componentWillReceiveProps: function(nextProps) { if (nextProps.path !== this.props.path) { var nextState = this.getRouterState(nextProps); this.delegateSetRoutingState(nextState); } },

To be safe we could do a shallow compare.

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