diff --git a/packages/hooks/src/use_context.rs b/packages/hooks/src/use_context.rs index 4e248e93ae..33aed61f7f 100644 --- a/packages/hooks/src/use_context.rs +++ b/packages/hooks/src/use_context.rs @@ -58,7 +58,6 @@ pub fn use_context() -> T { /// ``` pub fn use_context_provider(f: impl FnOnce() -> T) -> T { use_hook(|| { - let val = f(); - provide_context(val.clone()) + provide_context(f()) }) }