docs: use create_node_ref instead of NodeRef::new (#607)

Code in the example already updated by someone
This commit is contained in:
Ivan Agafonov 2023-03-02 15:22:18 +03:00 committed by GitHub
parent 0c261c0fb0
commit df90f183fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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.