Skip to content

Commit bffe7d6

Browse files
committed
Add Transition Tracing tests
1 parent f332dc0 commit bffe7d6

File tree

2 files changed

+663
-2
lines changed

2 files changed

+663
-2
lines changed

packages/react-noop-renderer/src/createReactNoop.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
* environment.
1515
*/
1616

17-
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
17+
import type {
18+
Fiber,
19+
TransitionTracingCallbacks,
20+
} from 'react-reconciler/src/ReactInternalTypes';
1821
import type {UpdateQueue} from 'react-reconciler/src/ReactUpdateQueue';
1922
import type {ReactNodeList, OffscreenMode} from 'shared/ReactTypes';
2023
import type {RootTag} from 'react-reconciler/src/ReactRootTags';
@@ -64,6 +67,10 @@ type TextInstance = {|
6467
context: HostContext,
6568
|};
6669
type HostContext = Object;
70+
type CreateRootOptions = {
71+
transitionCallbacks?: TransitionTracingCallbacks,
72+
...
73+
};
6774

6875
const NO_CONTEXT = {};
6976
const UPPERCASE_CONTEXT = {};
@@ -967,7 +974,7 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
967974
},
968975

969976
// TODO: Replace ReactNoop.render with createRoot + root.render
970-
createRoot() {
977+
createRoot(options?: CreateRootOptions) {
971978
const container = {
972979
rootID: '' + idCounter++,
973980
pendingChildren: [],
@@ -981,6 +988,9 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
981988
null,
982989
false,
983990
'',
991+
options && options.transitionCallbacks
992+
? options.transitionCallbacks
993+
: null,
984994
);
985995
return {
986996
_Scheduler: Scheduler,

0 commit comments

Comments
 (0)