@types/react-portal
Version:
TypeScript definitions for react-portal
48 lines (37 loc) • 1.58 kB
Markdown
# Installation
> `npm install --save @types/react-portal`
# Summary
This package contains type definitions for react-portal (https://github.com/tajo/react-portal#readme).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-portal.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-portal/index.d.ts)
````ts
import * as React from "react";
export interface PortalProps {
children: React.ReactNode;
node?: Element | null | undefined;
}
export const Portal: React.ComponentClass<PortalProps>;
export interface PortalFunctionParams {
openPortal: (event?: any) => void;
closePortal: () => void;
portal: (children: React.ReactNode) => React.ReactElement<React.ComponentClass<PortalProps>>;
isOpen: boolean;
}
export interface PortalWithStateProps {
children: (params: PortalFunctionParams) => React.ReactNode;
node?: Element | null | undefined;
defaultOpen?: boolean | undefined;
openByClickOn?: React.ReactElement | undefined;
closeOnEsc?: boolean | undefined;
closeOnOutsideClick?: boolean | undefined;
onOpen?(): void;
onClose?(): void;
}
export const PortalWithState: React.ComponentClass<PortalWithStateProps>;
````
### Additional Details
* Last updated: Tue, 12 Dec 2023 18:07:44 GMT
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
# Credits
These definitions were written by [Shun Takahashi](https://github.com/shuntksh), and [Horus Lugo](https://github.com/HorusGoul).