@types/react-dom

  • Version 18.2.17
  • Published
  • 33.1 kB
  • 1 dependency
  • MIT license

Install

npm i @types/react-dom
yarn add @types/react-dom
pnpm add @types/react-dom

Overview

TypeScript definitions for react-dom

Index

Variables

variable hydrate

const hydrate: Renderer;

    variable render

    const render: Renderer;

      variable version

      const version: string;

        Functions

        function createPortal

        createPortal: (
        children: ReactNode,
        container: Element | DocumentFragment,
        key?: null | string
        ) => ReactPortal;

          function findDOMNode

          findDOMNode: (
          instance: ReactInstance | null | undefined
          ) => Element | null | Text;

            function flushSync

            flushSync: { <R>(fn: () => R): R; <A, R>(fn: (a: A) => R, a: A): R };

              function preconnect

              preconnect: (href: string, options?: PreconnectOptions) => void;

                function prefetchDNS

                prefetchDNS: (href: string) => void;

                  function preinit

                  preinit: (href: string, options?: PreinitOptions) => void;

                    function preinitModule

                    preinitModule: (href: string, options?: PreinitModuleOptions) => void;

                      function preload

                      preload: (href: string, options?: PreloadOptions) => void;

                        function preloadModule

                        preloadModule: (href: string, options?: PreloadModuleOptions) => void;

                          function unmountComponentAtNode

                          unmountComponentAtNode: (container: Element | DocumentFragment) => boolean;

                            function unstable_batchedUpdates

                            unstable_batchedUpdates: {
                            <A, R>(callback: (a: A) => R, a: A): R;
                            <R>(callback: () => R): R;
                            };

                              function unstable_renderSubtreeIntoContainer

                              unstable_renderSubtreeIntoContainer: {
                              <T extends Element>(
                              parentComponent: Component<any>,
                              element: DOMElement<DOMAttributes<T>, T>,
                              container: Element,
                              callback?: (element: T) => any
                              ): T;
                              <P, T extends Component<P, ComponentState>>(
                              parentComponent: Component<any>,
                              element: CElement<P, T>,
                              container: Element,
                              callback?: (component: T) => any
                              ): T;
                              <P>(
                              parentComponent: Component<any>,
                              element: ReactElement<P>,
                              container: Element,
                              callback?: (component?: any) => any
                              ): any;
                              };

                                function useFormState

                                useFormState: {
                                <State>(
                                action: (state: Awaited<State>) => State | Promise<State>,
                                initialState: Awaited<State>,
                                permalink?: string
                                ): [state: Awaited<State>, dispatch: () => void];
                                <State, Payload>(
                                action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
                                initialState: Awaited<State>,
                                permalink?: string
                                ): [state: Awaited<State>, dispatch: (payload: Payload) => void];
                                };

                                  function useFormStatus

                                  useFormStatus: () => FormStatus;

                                    Interfaces

                                    interface FormStatusNotPending

                                    interface FormStatusNotPending {}

                                      property action

                                      action: null;

                                        property data

                                        data: null;

                                          property method

                                          method: null;

                                            property pending

                                            pending: false;

                                              interface FormStatusPending

                                              interface FormStatusPending {}

                                                property action

                                                action: string | ((formData: FormData) => void | Promise<void>);

                                                  property data

                                                  data: FormData;

                                                    property method

                                                    method: string;

                                                      property pending

                                                      pending: true;

                                                        interface PreconnectOptions

                                                        interface PreconnectOptions {}

                                                          property crossOrigin

                                                          crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined;

                                                            interface PreinitModuleOptions

                                                            interface PreinitModuleOptions {}

                                                              property as

                                                              as?: PreinitModuleAs;
                                                              • "script"

                                                              property crossOrigin

                                                              crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined;

                                                                property integrity

                                                                integrity?: string | undefined;

                                                                  property nonce

                                                                  nonce?: string | undefined;

                                                                    interface PreinitOptions

                                                                    interface PreinitOptions {}

                                                                      property as

                                                                      as: PreinitAs;

                                                                        property crossOrigin

                                                                        crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined;

                                                                          property fetchPriority

                                                                          fetchPriority?: 'high' | 'low' | 'auto' | undefined;

                                                                            property integrity

                                                                            integrity?: string | undefined;

                                                                              property nonce

                                                                              nonce?: string | undefined;

                                                                                property precedence

                                                                                precedence?: string | undefined;

                                                                                  interface PreloadModuleOptions

                                                                                  interface PreloadModuleOptions {}

                                                                                    property as

                                                                                    as: PreloadModuleAs;
                                                                                    • "script"

                                                                                    property crossOrigin

                                                                                    crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined;

                                                                                      property integrity

                                                                                      integrity?: string | undefined;

                                                                                        property nonce

                                                                                        nonce?: string | undefined;

                                                                                          interface PreloadOptions

                                                                                          interface PreloadOptions {}

                                                                                            property as

                                                                                            as: PreloadAs;

                                                                                              property crossOrigin

                                                                                              crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined;

                                                                                                property fetchPriority

                                                                                                fetchPriority?: 'high' | 'low' | 'auto' | undefined;

                                                                                                  property imageSizes

                                                                                                  imageSizes?: string | undefined;

                                                                                                    property imageSrcSet

                                                                                                    imageSrcSet?: string | undefined;

                                                                                                      property integrity

                                                                                                      integrity?: string | undefined;

                                                                                                        property nonce

                                                                                                        nonce?: string | undefined;

                                                                                                          property referrerPolicy

                                                                                                          referrerPolicy?: ReferrerPolicy | undefined;

                                                                                                            interface Renderer

                                                                                                            interface Renderer {}

                                                                                                              call signature

                                                                                                              <T extends Element>(
                                                                                                              element: DOMElement<DOMAttributes<T>, T>,
                                                                                                              container: Container | null,
                                                                                                              callback?: () => void
                                                                                                              ): T;

                                                                                                                call signature

                                                                                                                (
                                                                                                                element: Array<DOMElement<DOMAttributes<any>, any>>,
                                                                                                                container: Container | null,
                                                                                                                callback?: () => void
                                                                                                                ): Element;

                                                                                                                  call signature

                                                                                                                  (
                                                                                                                  element:
                                                                                                                  | FunctionComponentElement<any>
                                                                                                                  | Array<FunctionComponentElement<any>>,
                                                                                                                  container: Container | null,
                                                                                                                  callback?: () => void
                                                                                                                  ): void;

                                                                                                                    call signature

                                                                                                                    <P, T extends Component<P, ComponentState>>(
                                                                                                                    element: CElement<P, T>,
                                                                                                                    container: Container | null,
                                                                                                                    callback?: () => void
                                                                                                                    ): T;

                                                                                                                      call signature

                                                                                                                      (
                                                                                                                      element: Array<CElement<any, Component<any, ComponentState>>>,
                                                                                                                      container: Container | null,
                                                                                                                      callback?: () => void
                                                                                                                      ): Component<any, ComponentState>;

                                                                                                                        call signature

                                                                                                                        <P>(
                                                                                                                        element: ReactElement<P>,
                                                                                                                        container: Container | null,
                                                                                                                        callback?: () => void
                                                                                                                        // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
                                                                                                                        ): Component<P, ComponentState> | Element | void;

                                                                                                                          call signature

                                                                                                                          (
                                                                                                                          element: ReactElement[],
                                                                                                                          container: Container | null,
                                                                                                                          callback?: () => void
                                                                                                                          // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
                                                                                                                          ): Component<any, ComponentState> | Element | void;

                                                                                                                            Type Aliases

                                                                                                                            type Container

                                                                                                                            type Container = Element | Document | DocumentFragment;

                                                                                                                              type FormStatus

                                                                                                                              type FormStatus = FormStatusPending | FormStatusNotPending;

                                                                                                                                type PreinitAs

                                                                                                                                type PreinitAs = 'script' | 'style';

                                                                                                                                  type PreinitModuleAs

                                                                                                                                  type PreinitModuleAs = 'script';

                                                                                                                                    type PreloadAs

                                                                                                                                    type PreloadAs =
                                                                                                                                    | 'audio'
                                                                                                                                    | 'document'
                                                                                                                                    | 'embed'
                                                                                                                                    | 'fetch'
                                                                                                                                    | 'font'
                                                                                                                                    | 'image'
                                                                                                                                    | 'object'
                                                                                                                                    | 'track'
                                                                                                                                    | 'script'
                                                                                                                                    | 'style'
                                                                                                                                    | 'video'
                                                                                                                                    | 'worker';

                                                                                                                                      type PreloadModuleAs

                                                                                                                                      type PreloadModuleAs = RequestDestination;

                                                                                                                                        Package Files (2)

                                                                                                                                        Dependencies (1)

                                                                                                                                        Dev Dependencies (0)

                                                                                                                                        No dev dependencies.

                                                                                                                                        Peer Dependencies (0)

                                                                                                                                        No peer dependencies.

                                                                                                                                        Badge

                                                                                                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/react-dom.

                                                                                                                                        • Markdown
                                                                                                                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/react-dom)
                                                                                                                                        • HTML
                                                                                                                                          <a href="https://www.jsdocs.io/package/@types/react-dom"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>