fix some examples that used the private API

This commit is contained in:
Evan Almloff committed 2023-07-26 16:50:04 -07:00
1 parent 2d51a1c4f2
commit 20296b5038
2 files changed
+12 -25

No files matched your search

+3 -6
View File
@@ -262,12 +262,9 @@ fn create_random_element(cx: Scope<DepthProps>) -> Element {
let dynamic_nodes: Vec<_> = dynamic_node_types
.iter()
.map(|ty| match ty {
DynamicNodeType::Text => DynamicNode::Text(VText {
value: Box::leak(
format!("{}", rand::random::<usize>()).into_boxed_str(),
),
id: Default::default(),
}),
DynamicNodeType::Text => DynamicNode::Text(VText::new(Box::leak(
format!("{}", rand::random::<usize>()).into_boxed_str(),
))),
DynamicNodeType::Other => {
create_random_dynamic_node(cx, cx.props.depth + 1)
}