pub struct ScopeState { /* private fields */ }Expand description
A component’s rendered state.
This state erases the type of the component’s props. It is used to store the state of a component in the runtime.
Implementations§
Source§impl ScopeState
impl ScopeState
Sourcepub fn root_node(&self) -> &VNode
pub fn root_node(&self) -> &VNode
Get a handle to the currently active head node arena for this Scope
This is useful for traversing the tree outside of the VirtualDom, such as in a custom renderer or in SSR.
Panics if the tree has not been built yet.
Sourcepub fn try_root_node(&self) -> Option<&VNode>
pub fn try_root_node(&self) -> Option<&VNode>
Try to get a handle to the currently active head node arena for this Scope
This is useful for traversing the tree outside of the VirtualDom, such as in a custom renderer or in SSR.
Returns None if the tree has not been built yet.
Sourcepub fn try_mounted_root_node(&self) -> Option<MountedVNode<'_>>
pub fn try_mounted_root_node(&self) -> Option<MountedVNode<'_>>
Try to get the currently active root node with its mounted identity.
Returns None if the tree has not been built or mounted yet.
Sourcepub fn id(&self) -> ScopeId
pub fn id(&self) -> ScopeId
Returns the scope id of this ScopeState.