wip: stop transmuting reference

This commit is contained in:
Jonathan Kelley committed 2022-11-21 17:00:34 -08:00
1 parent d407035931
commit 491bf4332d
8 files changed
+263 -244

No files matched your search

+2 -1
View File
@@ -2,6 +2,7 @@ use crate::{
any_props::AnyProps,
arena::ElementId,
bump_frame::BumpFrame,
factory::RenderReturn,
innerlude::{Scheduler, SchedulerMsg},
lazynodes::LazyNodes,
nodes::VNode,
@@ -116,7 +117,7 @@ impl ScopeState {
/// 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.
pub fn root_node<'a>(&'a self) -> &'a VNode<'a> {
pub fn root_node<'a>(&'a self) -> &'a RenderReturn<'a> {
let r = unsafe { &*self.current_frame().node.get() };
unsafe { std::mem::transmute(r) }
}