Skip to content

Recreate withRouter HOC from next/router using new Context API from React #5404

@dmytro-lymarenko

Description

@dmytro-lymarenko

Bug report

Describe the bug

if we have the next tree of components:
<ComponentWithShouldComponentUpdate> <ComponentWithRouter /> </ComponentWithShouldComponentUpdate>
where ComponentWithShouldComponentUpdate has shouldComponentUpdate which in some cases returns false then ComponentWithRouter doesn't update its context and so ComponentWithRouter has stale router prop :( .

To Reproduce

just render the tree described above

Expected behavior

router prop should be up to date.

Screenshots

no screenshots provided

System information

  • OS: should not depend on OS
  • Browser: should not depend on Browser
  • Version of Next.js: [e.g. 7.0.1]

Additional context

no additional context

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