UNPKG

@prezly/react-promise-modal

Version:

The proper (and easy) way of doing modals in React. With Promises.

22 lines (21 loc) 682 B
import * as React from "react"; export type Milliseconds = number; type Props = { isOpen: boolean; onClosed?: () => void; transitionDuration: Milliseconds; render: (props: RenderProps) => React.ReactElement | null; }; type RenderProps = { isOpen: boolean; stage: `${Stage.OPEN | Stage.OPENING | Stage.CLOSING}`; onClose: () => void; }; export declare enum Stage { OPEN = "open", OPENING = "opening", CLOSING = "closing", CLOSED = "closed" } export declare function ModalTransitions({ isOpen: shouldOpen, onClosed, transitionDuration, render }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; export {};