@types/react-portal
TypeScript icon, indicating that this package has built-in type declarations

4.0.7 • Public • Published

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

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

Credits

These definitions were written by Shun Takahashi, and Horus Lugo.

/@types/react-portal/

    Package Sidebar

    Install

    npm i @types/react-portal

    Weekly Downloads

    72,512

    Version

    4.0.7

    License

    MIT

    Unpacked Size

    4.57 kB

    Total Files

    5

    Last publish

    Collaborators

    • types