React16 added the lifecycle method getSnapshotBeforeUpdate. We needed to add this to Component2 and begin the transition of removing older lifecycle events that will no longer work.
Changes
Add the new lifecycle event to react.dart, react_client, react_interop, and _dart_helpers.
Add an optional third parameter to componentDidUpdate.
Add a mixin that can be used to ensure type consistency between the return value of getSnapshotBeforeUpdate and the new third parameter for componentDidUpdate.
Remove componentWillUpdate from react_interop.
Add deprecation messages to the method.
Add new tests.
Adjust old tests that relied upon lifecycle methods that are no longer being called for Component2.
Testing suggestions:
CI Passes
Double check that the new added tests are not false positives
Manually test the new lifecycle methods and ensure the return value of getSnapshotBeforeUpdate gets passed to componentDidUpdate successfully.
Potential areas of regression:
There shouldn't be any for consumers as Component2 is new, but any code reliant upon old Component2 lifecycle events would now break.
Description:
React16 added the lifecycle method
getSnapshotBeforeUpdate
. We needed to add this to Component2 and begin the transition of removing older lifecycle events that will no longer work.Changes
componentDidUpdate
.getSnapshotBeforeUpdate
and the new third parameter forcomponentDidUpdate
.Testing suggestions:
getSnapshotBeforeUpdate
gets passed tocomponentDidUpdate
successfully.Potential areas of regression:
There shouldn't be any for consumers as Component2 is new, but any code reliant upon old Component2 lifecycle events would now break.