4.0.7 • Published 2 months ago

@types/react-portal v4.0.7

Weekly downloads
30,318
License
MIT
Repository
github
Last release
2 months ago

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/v3.

index.d.ts

// Type definitions for react-portal 3.0
// Project: https://github.com/tajo/react-portal#readme
// Definitions by: Shun Takahashi <https://github.com/shuntksh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import * as React from "react";

interface CallBackProps {
    children?: React.ReactNode;
    ref?: React.LegacyRef<any> | undefined;
    closePortal(): void;
}

interface ReactPortalProps {
    children: React.ReactElement;
    isOpened?: boolean | undefined;
    openByClickOn?: React.ReactElement<CallBackProps> | undefined;
    closeOnEsc?: boolean | undefined;
    closeOnOutsideClick?: boolean | undefined;
    onOpen?(node: HTMLDivElement): void;
    beforeClose?(node: HTMLDivElement, resetPortalState: () => void): void;
    onClose?(): void;
    onUpdate?(): void;
}

declare const ReactPortal: React.ComponentClass<ReactPortalProps>;
export = ReactPortal;

Additional Details

  • Last updated: Thu, 21 Oct 2021 23:01:41 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Shun Takahashi.