Skip to content

Commit

Permalink
Add Transition Tracing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lunaruan committed Feb 4, 2022
1 parent f332dc0 commit 24cc737
Show file tree
Hide file tree
Showing 2 changed files with 666 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/react-noop-renderer/src/createReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
* environment.
*/

import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {
Fiber,
TransitionTracingCallbacks,
} from 'react-reconciler/src/ReactInternalTypes';
import type {UpdateQueue} from 'react-reconciler/src/ReactUpdateQueue';
import type {ReactNodeList, OffscreenMode} from 'shared/ReactTypes';
import type {RootTag} from 'react-reconciler/src/ReactRootTags';
Expand Down Expand Up @@ -64,6 +67,10 @@ type TextInstance = {|
context: HostContext,
|};
type HostContext = Object;
type CreateRootOptions = {
transitionCallbacks?: TransitionTracingCallbacks,
...
};

const NO_CONTEXT = {};
const UPPERCASE_CONTEXT = {};
Expand Down Expand Up @@ -967,7 +974,7 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
},

// TODO: Replace ReactNoop.render with createRoot + root.render
createRoot() {
createRoot(options?: CreateRootOptions) {
const container = {
rootID: '' + idCounter++,
pendingChildren: [],
Expand All @@ -981,6 +988,9 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
null,
false,
'',
options && options.transitionCallbacks
? options.transitionCallbacks
: null,
);
return {
_Scheduler: Scheduler,
Expand Down
Loading

0 comments on commit 24cc737

Please sign in to comment.