only subscribe scopes to signals when rendering
This commit is contained in:
1 parent
49f3b8235d
commit
48751d2f98
14 files changed
+424
-48
No files matched your search
@@ -11,17 +11,17 @@
|
||||
/// ```
|
||||
/// # use dioxus::prelude::*;
|
||||
/// #
|
||||
/// # #[derive(Props, PartialEq)]
|
||||
/// # #[derive(Props, PartialEq, Clone)]
|
||||
/// # struct Props {
|
||||
/// # prop: String,
|
||||
/// # }
|
||||
/// # fn Component(cx: Scope<Props>) -> Element {
|
||||
/// # fn Component(props: Props) -> Element {
|
||||
///
|
||||
/// let (data) = use_signal(|| {});
|
||||
///
|
||||
/// let handle_thing = move |_| {
|
||||
/// to_owned![data, cx.props.prop];
|
||||
/// cx.spawn(async move {
|
||||
/// to_owned![data, props.prop];
|
||||
/// spawn(async move {
|
||||
/// // do stuff
|
||||
/// });
|
||||
/// };
|
||||
|
||||
Reference in new issue
Block a user