wip: go back to noisy lifetime solution

This commit is contained in:
Jonathan Kelley committed 2021-12-14 02:27:59 -05:00
1 parent 0545d27182
commit 8daf7a6ed8
31 files changed
+214 -170

No files matched your search

+1 -2
View File
@@ -50,10 +50,9 @@ use std::{
/// }
/// ```
pub fn use_state<'a, T: 'static>(
cx: &dyn AnyContext<'a>,
cx: &'a ScopeState,
initial_state_fn: impl FnOnce() -> T,
) -> UseState<'a, T> {
let cx = cx.get_scope();
cx.use_hook(
move |_| {
let first_val = initial_state_fn();