useImperativeHandle<T> function

dynamic useImperativeHandle<T>(
  1. Ref<T> ref,
  2. T create()
)

Implementation

useImperativeHandle<T>(Ref<T> ref, T Function() create) {
  useEffect(() {
    ref.value = create();
    return () => ref.value = null;
  }, [ref]);
}