React Raw Text Shadow Node
ReactShadowNode class for pure raw text node (aka textContent
in terms of DOM). Raw text node can only have simple string value without any attributes, properties or state.
Functions
Adds a child that the native view hierarchy will have at this index in the native view corresponding to this node.
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 nodes (nodes not optimized out of the native tree) that are a) to the left (visited before by a DFS) of the given child in the subtree rooted at this node and b) do not have a native parent in this subtree (which means that the given child will be a sibling of theirs in the final native hierarchy since they'll get attached to the same native parent).
Get the ThemedReactContext associated with this ReactShadowNode. This will never change during the lifetime of a ReactShadowNode instance, but different instances can have different contexts; don't cache any calculations based on theme values globally.
When constructing the native tree, nodes that return true
will be treated as leaves. Instead of adding this view's native children as subviews of it, they will be added as subviews of an ancestor. In other words, this view wants to support native children but it cannot host them itself (e.g. it isn't a ViewGroup).
Nodes that return true
will be treated as a root view for the virtual nodes tree. It means that all of its descendants will be "virtual" nodes. Good example is InputText
view that may have children Text
nodes but this whole hierarchy will be mapped to a single android EditText view.
Nodes that return true
will not manage (and and remove) child Yoga nodes. For example ReactTextInputShadowNode or ReactTextShadowNode have child nodes, which do not want Yoga to lay out, so in the eyes of Yoga it is a leaf node. Override this method in subclass to enforce this requirement.
This method will be called by UIManagerModule once per batch, before calculating layout. Will be only called for nodes that are marked as updated with markUpdated or require layouting (marked with dirty).
Called after layout step at the end of the UI batch from UIManagerModule. May be used to enqueue additional ui operations for the native view. Will only be called on nodes marked as updated either with dirty or markUpdated.
Sets whether this node only contributes to the layout of its children without doing any drawing or functionality itself.