only subscribe scopes to signals when rendering

This commit is contained in:
Evan Almloff committed 2024-02-14 09:33:22 -06:00
1 parent 49f3b8235d
commit 48751d2f98
14 files changed
+424 -48

No files matched your search

+4 -4
View File
@@ -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
/// });
/// };