RefState component
All checks were successful
Lint / lint (push) Successful in 58s

This commit is contained in:
Julien Valverdé
2025-04-10 22:38:29 +02:00
parent 3b844f071b
commit 52a36cb882

View File

@@ -418,6 +418,17 @@ export abstract class ReffuseHelpers<R> {
return stream
}
RefState<A>(
this: ReffuseHelpers<R>,
props: {
readonly ref: SubscriptionRef.SubscriptionRef<A>
readonly children: (state: [A, React.Dispatch<React.SetStateAction<A>>]) => React.ReactNode
},
): React.ReactNode {
return props.children(this.useRefState(props.ref))
}
}