UNPKG

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