Pass incomingState to _buildState#132
Conversation
This will handle the case where _buildState relies on a value that can be changed by calling setState Fixes microsoft#131
|
|
||
| React’s `setState` method should not be called directly in this function. Instead, the new state should be returned and `ComponentBase` will handle the update of the state. | ||
|
|
||
| Note: If your _buildState ever relies on component state, utilize the incomingState argument, otherwise you risk using an old snapshot of the state (See https://github.com/microsoft/ReSub/issues/131 for more details) |
There was a problem hiding this comment.
I feel like this might be noted here - https://github.com/microsoft/ReSub/blob/master/README.md#L9 - when I do breaking changes I usually have a separate migration page linked in changelog + readme for each major version change where I give an example of what to look for, and how to change it. Otherwise I get bombed with issues later - pay me now / pay me later. $0.02
There was a problem hiding this comment.
This is separate but possibly also worth noting I saw my react migration tidbits in there but I'm not sure they are valid anymore? 'UNSAFE_' anything - https://github.com/microsoft/ReSub/blob/master/README.md#L370
This will handle the case where _buildState relies on a value that can be changed by calling setState
Fixes #131