diff --git a/tachys/src/html/directive.rs b/tachys/src/html/directive.rs index b38af28fc..5fab0b26f 100644 --- a/tachys/src/html/directive.rs +++ b/tachys/src/html/directive.rs @@ -47,11 +47,13 @@ pub fn directive(handler: D, param: P) -> Directive where D: IntoDirective, { - Directive(Some(SendWrapper::new(DirectiveInner { - handler, - param, - t: PhantomData, - }))) + Directive((!cfg!(feature = "ssr")).then(|| { + SendWrapper::new(DirectiveInner { + handler, + param, + t: PhantomData, + }) + })) } /// Custom logic that runs in the browser when the element is created or hydrated. @@ -151,13 +153,7 @@ where Directive(inner) } - fn dry_resolve(&mut self) { - // dry_resolve() only runs during SSR, and we should use it to - // synchronously remove and drop the SendWrapper value - // we don't need this value during SSR and leaving it here could drop it - // from a different thread - self.0.take(); - } + fn dry_resolve(&mut self) {} async fn resolve(self) -> Self::AsyncOutput { self diff --git a/tachys/src/html/event.rs b/tachys/src/html/event.rs index 8083b5e9f..22b3df312 100644 --- a/tachys/src/html/event.rs +++ b/tachys/src/html/event.rs @@ -113,7 +113,7 @@ where event, #[cfg(feature = "reactive_graph")] owner: reactive_graph::owner::Owner::current().unwrap_or_default(), - cb: Some(SendWrapper::new(cb)), + cb: (!cfg!(feature = "ssr")).then(|| SendWrapper::new(cb)), } } @@ -352,13 +352,7 @@ where } } - fn dry_resolve(&mut self) { - // dry_resolve() only runs during SSR, and we should use it to - // synchronously remove and drop the SendWrapper value - // we don't need this value during SSR and leaving it here could drop it - // from a different thread - self.cb.take(); - } + fn dry_resolve(&mut self) {} async fn resolve(self) -> Self::AsyncOutput { self diff --git a/tachys/src/html/property.rs b/tachys/src/html/property.rs index ac94a1808..9c435b82c 100644 --- a/tachys/src/html/property.rs +++ b/tachys/src/html/property.rs @@ -22,7 +22,7 @@ where { Property { key, - value: Some(SendWrapper::new(value)), + value: (!cfg!(feature = "ssr")).then(|| SendWrapper::new(value)), } } @@ -115,13 +115,7 @@ where } } - fn dry_resolve(&mut self) { - // dry_resolve() only runs during SSR, and we should use it to - // synchronously remove and drop the SendWrapper value - // we don't need this value during SSR and leaving it here could drop it - // from a different thread - self.value.take(); - } + fn dry_resolve(&mut self) {} async fn resolve(self) -> Self::AsyncOutput { self