Skip to content

match object is always newly created  #5099

@greenimpala

Description

@greenimpala

<Route> components pass props.match as a fresh object when the URL / params have not changed. Is this by design? This was not the case with RR V3. This breaks the PureComponent paradigm. See codepen below for example.

Version

4.0.0

Test Case

https://codepen.io/anon/pen/NjYwZO?editors=1112

Steps to reproduce

Render a PureComponent within a Route.

Expected Behavior

If the URL has not changed then re-renders of the Route should be passed the same props.

Actual Behavior

match is always a new object causing the component to be re-rendered. Even though its contents are unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions