@styleless-ui/react
Version:
Completely unstyled, headless and accessible React UI components.
10 lines (9 loc) • 431 B
TypeScript
import * as React from "react";
/**
* A community-wide workaround for `useCallback()`.
* Because the `useCallback()` hook invalidates too often in practice.
*
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
*/
declare const useEventCallback: <E extends Event | React.BaseSyntheticEvent<object, any, any>, T extends (event: E) => void = (event: E) => void>(fn: T) => T;
export default useEventCallback;