Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Andarist opened this issue Feb 18, 2019 · 3 comments
Closed

Comments

@Andarist
Copy link
Contributor

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.

@gaearon gaearon 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 Feb 18, 2019
@stale
Copy link

stale bot commented Jan 10, 2020

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.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@Andarist
Copy link
Contributor Author

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

@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Jan 11, 2020
@gaearon
Copy link
Collaborator

gaearon commented Apr 28, 2022

Fixed by #24421

@gaearon gaearon closed this as completed Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants