mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Introducting UIManager.setLocalData(), the way to provide environmental data to ShadowNode
Summary: In some cases we need a way to provide some peice of data to shadow node to improve layout (or do something similar), `setLocalData` allows to do this. Reviewed By: AaaChiuuu Differential Revision: D5828368 fbshipit-source-id: bf6a04f460dc7695a16269426d365b78909bc8eb
This commit is contained in:
committed by
Facebook Github Bot
parent
abed3cf6c4
commit
d0790fea39
@@ -181,6 +181,18 @@ public interface ReactShadowNode<T extends ReactShadowNode> {
|
||||
|
||||
boolean isDescendantOf(T ancestorNode);
|
||||
|
||||
/*
|
||||
* In some cases we need a way to specify some environmental data to shadow node
|
||||
* to improve layout (or do something similar), so {@code localData} serves these needs.
|
||||
* For example, any stateful embedded native views may benefit from this.
|
||||
* Have in mind that this data is not supposed to interfere with the state of
|
||||
* the shadow node.
|
||||
* Please respect one-directional data flow of React.
|
||||
* Use {@link UIManagerModule#setViewLocalData} to set this property
|
||||
* (to provide local/environmental data for a shadow node) from the main thread.
|
||||
*/
|
||||
public void setLocalData(Object data);
|
||||
|
||||
/**
|
||||
* Returns the offset within the native children owned by all layout-only nodes in the subtree
|
||||
* rooted at this node for the given child. Put another way, this returns the number of native
|
||||
|
||||
Reference in New Issue
Block a user