docs: use create_node_ref instead of NodeRef::new (#607)
Code in the example already updated by someone
This commit is contained in:
parent
0c261c0fb0
commit
df90f183fd
|
@ -54,7 +54,7 @@ event.
|
||||||
```rust
|
```rust
|
||||||
let (name, set_name) = create_signal(cx, "Uncontrolled".to_string());
|
let (name, set_name) = create_signal(cx, "Uncontrolled".to_string());
|
||||||
|
|
||||||
let input_element: NodeRef<HtmlElement<Input>> = NodeRef::new(cx);
|
let input_element: NodeRef<Input> = create_node_ref(cx);
|
||||||
```
|
```
|
||||||
`NodeRef` is a kind of reactive smart pointer: we can use it to access the
|
`NodeRef` is a kind of reactive smart pointer: we can use it to access the
|
||||||
underlying DOM node. Its value will be set when the element is rendered.
|
underlying DOM node. Its value will be set when the element is rendered.
|
||||||
|
|
Loading…
Reference in New Issue