Skip to content

Simple memo components being updated with new set of props during context change #14878

Closed

Description

@Andarist

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Simple memo components receive new props during context change if their parent got rerendered.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

https://codesandbox.io/s/jp21pwzrv9

What is the expected behavior?

Conceptually from the user's perspective React.memo(Component) & React.memo(Component, shallowEqual) should behave exactly the same (but they dont)

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Current React's master ( 0e67969 ) & current latest release 16.8.2

I've already written a failing test for this - #14876 . Would love to work on fixing this but as mentioned in this PR, I would require some guidance on how this should get fixed properly.

Activity

  1. changed the title [-][bug] Simple memo components being updated with new set of props during context change[/-] [+]Simple memo components being updated with new set of props during context change[/+] on Feb 18, 2019
  2. stale commented on Jan 10, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

  3. Andarist commented on Jan 11, 2020

    @Andarist
    ContributorAuthor

    I still believe the issue is sound, and unless closed by React team member it shouldn't be treated as stale.

  4. gaearon commented on Apr 28, 2022

    @gaearon
    Collaborator

    Fixed by #24421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions