Skip to content

render prop remounts the component on every route change #5972

@trassmann

Description

@trassmann

Version

4.2.0

Test Case

https://codesandbox.io/s/j2p1r0kvx5

Expected Behavior

According to the documentation here: https://reacttraining.com/react-router/web/api/Route/render-func the inline render with a render prop should not remount the component every time.

Actual Behavior

You can see from the console logs that the Test component is unmounted and mounted again for every route change.

I have been trying to find a reason for this since yesterday. But even in the simplest test case this still happens. Please excuse my lack of knowledge, if this is not a bug, please explain what is happening.

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