1 | /**
|
2 | * These are types for things that are present in the React 18 alpha.
|
3 | *
|
4 | * Once React 18 is released they can just be moved to the main index file.
|
5 | *
|
6 | * To load the types declared here in an actual project, there are three ways. The easiest one,
|
7 | * if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
8 | * is to add `"react-is/canary"` to the `"types"` array.
|
9 | *
|
10 | * Alternatively, a specific import syntax can to be used from a typescript file.
|
11 | * This module does not exist in reality, which is why the {} is important:
|
12 | *
|
13 | * ```ts
|
14 | * import {} from 'react-is/canary'
|
15 | * ```
|
16 | *
|
17 | * It is also possible to include it through a triple-slash reference:
|
18 | *
|
19 | * ```ts
|
20 | * /// <reference types="react-is/canary" />
|
21 | * ```
|
22 | *
|
23 | * Either the import or the reference only needs to appear once, anywhere in the project.
|
24 | */
|
25 |
|
26 | // See https://github.com/facebook/react/blob/master/packages/react-is/src/ReactIs.js to see how the exports are declared,
|
27 |
|
28 | import ReactIs = require(".");
|
29 | import { ReactElement } from "react";
|
30 |
|
31 | export {};
|
32 |
|
33 | declare module "." {
|
34 | function isSuspenseList(value: any): value is ReactElement;
|
35 |
|
36 | const SuspenseList: symbol;
|
37 | }
|