remove cx.render
This commit is contained in:
159 files changed
+600
-658
No files matched your search
@@ -21,7 +21,7 @@ use std::{
|
||||
/// fn Example() -> Element {
|
||||
/// let mut count = use_atom_state(&COUNT);
|
||||
///
|
||||
/// cx.render(rsx! {
|
||||
/// rsx! {
|
||||
/// div {
|
||||
/// h1 { "Count: {count}" }
|
||||
/// button { onclick: move |_| count += 1, "Increment" }
|
||||
@@ -75,7 +75,7 @@ impl<T: 'static> AtomState<T> {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn component() -> Element {
|
||||
/// let count = use_state(|| 0);
|
||||
/// let count = use_signal(|| 0);
|
||||
/// cx.spawn({
|
||||
/// let set_count = count.to_owned();
|
||||
/// async move {
|
||||
@@ -104,7 +104,7 @@ impl<T: 'static> AtomState<T> {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn component() -> Element {
|
||||
/// let value = use_state(|| 0);
|
||||
/// let value = use_signal(|| 0);
|
||||
///
|
||||
/// rsx!{
|
||||
/// Component {
|
||||
@@ -131,7 +131,7 @@ impl<T: 'static> AtomState<T> {
|
||||
/// # use dioxus_core::prelude::*;
|
||||
/// # use dioxus_hooks::*;
|
||||
/// fn component() -> Element {
|
||||
/// let value = use_state(|| 0);
|
||||
/// let value = use_signal(|| 0);
|
||||
///
|
||||
/// // to increment the value
|
||||
/// value.modify(|v| v + 1);
|
||||
@@ -171,7 +171,7 @@ impl<T: 'static> AtomState<T> {
|
||||
/// # use dioxus_core::prelude::*;
|
||||
/// # use dioxus_hooks::*;
|
||||
/// fn component() -> Element {
|
||||
/// let value = use_state(|| 0);
|
||||
/// let value = use_signal(|| 0);
|
||||
///
|
||||
/// let as_rc = value.get();
|
||||
/// assert_eq!(as_rc.as_ref(), &0);
|
||||
@@ -193,7 +193,7 @@ impl<T: 'static> AtomState<T> {
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// fn component() -> Element {
|
||||
/// let count = use_state(|| 0);
|
||||
/// let count = use_signal(|| 0);
|
||||
/// cx.spawn({
|
||||
/// let count = count.to_owned();
|
||||
/// async move {
|
||||
@@ -223,7 +223,7 @@ impl<T: Clone> AtomState<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```ignore
|
||||
/// let val = use_state(|| 0);
|
||||
/// let val = use_signal(|| 0);
|
||||
///
|
||||
/// val.with_mut(|v| *v = 1);
|
||||
/// ```
|
||||
@@ -246,7 +246,7 @@ impl<T: Clone> AtomState<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```ignore
|
||||
/// let val = use_state(|| 0);
|
||||
/// let val = use_signal(|| 0);
|
||||
///
|
||||
/// *val.make_mut() += 1;
|
||||
/// ```
|
||||
|
||||
Reference in new issue
Block a user