UNPKG

react-use-hook-modal

Version:

A React Hook library for declaratively managing modals, eliminating the need for state declarations. Props can be passed directly through function calls, simplifying modal control in your application.

5 lines (4 loc) 193 B
import type { UseModalReturn } from '../types/modal'; export default function useModal<TProps extends { isOpen: boolean; }>(Component: React.ComponentType<TProps>): UseModalReturn<TProps>;