Created
November 15, 2019 00:42
-
-
Save jbr/360c93d42e0c3df0742115fb78df732e to your computer and use it in GitHub Desktop.
TypeScript types for React DOM Concurrent Mode API (createRoot and createBlockingRoot)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare module "react-dom" { | |
| interface ReactRoot { | |
| render(children: React.ReactNode, callback?: () => void): void; | |
| unmount(callback?: () => void): void; | |
| } | |
| interface RootOptions { | |
| hydrate?: boolean; | |
| hydrationOptions?: { | |
| onHydrated?: (suspenseNode: unknown) => void; | |
| onDeleted?: (suspenseNode: unknown) => void; | |
| }; | |
| } | |
| export function createBlockingRoot( | |
| element: HTMLElement | null, | |
| options?: RootOptions | |
| ): ReactRoot; | |
| export function createRoot( | |
| element: HTMLElement | null, | |
| options?: RootOptions | |
| ): ReactRoot; | |
| } | |
| ¯ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment