fix: allow component to use span prop when tracing feature is enabled (#2969)

This commit is contained in:
luoxiaozero 2024-09-13 21:35:59 +08:00 committed by GitHub
parent 96a1f80daf
commit d7881ccfb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -204,11 +204,11 @@ impl ToTokens for Model {
)]
},
quote! {
let span = ::leptos::tracing::Span::current();
let __span = ::leptos::tracing::Span::current();
},
quote! {
#[cfg(debug_assertions)]
let _guard = span.entered();
let _guard = __span.entered();
},
if no_props || !cfg!(feature = "trace-component-props") {
quote!()