-
Notifications
You must be signed in to change notification settings - Fork 49k
Closed
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
React version: experimental
Steps To Reproduce
https://codesandbox.io/s/react-redux-usemutablesource-j1vgy
(modified from Brian Vaughn's fake react-redux demo)
- Increment Buttons1(update
state.s1
) for several times, only Label1 is rerendered, which is expected. - Increment Buttons2(update
state.s2
), both Label1 and Label2 is rerendered, which is unexpected.Also notice that the unexpected render of Label1 is not commited, even when the render return value is different(since it render
Math.random()
).
Since Label1 return the same state.s1
from getSnapshot
, Label1 should not rerendered.
This bug may lead to worse performance, because Components are rerendered for state fields that they don't need.
@bvaughn may be interested in this.
@dai-shi may also be interested in this because his use-context-selector need the correct behaviour to be efficient
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug