Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions types/react-dom/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,12 @@
* Either the import or the reference only needs to appear once, anywhere in the project.
*/

// See https://github.com/facebook/react/blob/master/packages/react-dom/src/client/ReactDOM.js to see how the exports are declared,
// and https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js to verify which APIs are
// flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
// See https://github.com/facebook/react/blob/main/packages/react-dom/index.experimental.js to see how the exports are declared,
// but confirm with published source code (e.g. https://unpkg.com/react-dom@experimental) that these exports end up in the published code

import React = require('react');
import ReactDOM = require('./next');

export {};

declare module '.' {
function unstable_flushControlled(callback: () => void): void;

// enableSelectiveHydration feature

/**
* @see https://github.com/facebook/react/commit/3a2b5f148d450c69aab67f055fc441d294c23518
*/
function unstable_scheduleHydration(target: Element | Document | DocumentFragment | Comment): void;
}
declare module '.' {}
3 changes: 2 additions & 1 deletion types/react-dom/next.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
* Either the import or the reference only needs to appear once, anywhere in the project.
*/

// See https://github.com/facebook/react/blob/master/packages/react-dom/src/client/ReactDOM.js to see how the exports are declared,
// See https://github.com/facebook/react/blob/main/packages/react-dom/index.js to see how the exports are declared,
// but confirm with published source code (e.g. https://unpkg.com/react-dom@next) that these exports end up in the published code

import React = require('react');
import ReactDOM = require('.');
Expand Down
8 changes: 0 additions & 8 deletions types/react-dom/test/experimental-tests.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
import ReactDOM = require('react-dom');
import 'react-dom/experimental';

// NOTE: I don't know yet how to use this; this is just the type it expects
// in reality it will do nothing because the root isn't hydrate: true
ReactDOM.unstable_scheduleHydration(document);

function updates() {
ReactDOM.unstable_flushControlled(() => {});
}