Allow update of state to receive null objects

Summary:
This diff changes updateState method to support null stateWrappers, before this method would crash with a NullPointerException, now it allows the null object to reach the view manager.

Changelog: Add support for update of nullable localState in Fabric

Reviewed By: JoshuaGross

Differential Revision: D17939651

fbshipit-source-id: c62555905e39f9e0db75b9e1d1b93f33d0560266
This commit is contained in:
David Vacca authored and Facebook Github Bot committed 2019-10-15 18:52:26 -07:00
1 parent 79b573511b
commit c65267ca6f
6 files changed
+13 -10

No files matched your search

@@ -282,7 +282,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
* this component type.
*/
public @Nullable Object updateState(
@NonNull T view, ReactStylesDiffMap props, StateWrapper stateWrapper) {
@NonNull T view, ReactStylesDiffMap props, @Nullable StateWrapper stateWrapper) {
return null;
}