fix hotreloading issues in the CLI

This commit is contained in:
Jonathan Kelley committed 2024-03-12 13:39:42 -07:00
1 parent d180f569cf
commit ad7a350d2e
37 files changed
+818 -805

No files matched your search

+2 -2
View File
@@ -77,8 +77,8 @@ fn is_component_fn(item_fn: &syn::ItemFn) -> bool {
fn get_closure_hook_body(local: &syn::Local) -> Option<&syn::Expr> {
if let Pat::Ident(ident) = &local.pat {
if is_hook_ident(&ident.ident) {
if let Some((_, expr)) = &local.init {
if let syn::Expr::Closure(closure) = &**expr {
if let Some(init) = &local.init {
if let syn::Expr::Closure(closure) = init.expr.as_ref() {
return Some(&closure.body);
}
}