mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Always pass props and state to Create mount item
Summary: For Litho interop and to resolve T47926405, always pass props and state to Create mount item so that any ViewManager can create view instances with knowledge of initial props and state. Reviewed By: mdvacca Differential Revision: D16554082 fbshipit-source-id: 3b19a43347b0fa201a054eec60e82fb77cad3625
This commit is contained in:
committed by
Facebook Github Bot
parent
f22a7c67bd
commit
bf5e73e46c
@@ -117,6 +117,12 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
|
||||
if (initialProps != null) {
|
||||
updateProperties(view, initialProps);
|
||||
}
|
||||
if (stateWrapper != null) {
|
||||
Object extraData = updateState(view, initialProps, stateWrapper);
|
||||
if (extraData != null) {
|
||||
updateExtraData(view, extraData);
|
||||
}
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -150,7 +156,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
|
||||
* x/y/width/height this is the recommended and thread-safe way of passing extra data from css
|
||||
* node to the native view counterpart.
|
||||
*
|
||||
* <p>TODO(7247021): Replace updateExtraData with generic update props mechanism after D2086999
|
||||
* <p>TODO T7247021: Replace updateExtraData with generic update props mechanism after D2086999
|
||||
*/
|
||||
public abstract void updateExtraData(@NonNull T root, Object extraData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user