Skip to content

Commit

Permalink
Failing: Dropped effects in Legacy Mode Suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Mar 6, 2020
1 parent 115cd12 commit 8dea154
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-noop-renderer/src/ReactNoop.js
Expand Up @@ -24,6 +24,7 @@ export const {
getOrCreateRootContainer,
createRoot,
createBlockingRoot,
createLegacyRoot,
getChildrenAsJSX,
getPendingChildrenAsJSX,
createPortal,
Expand Down
26 changes: 26 additions & 0 deletions packages/react-noop-renderer/src/createReactNoop.js
Expand Up @@ -785,6 +785,32 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
};
},

createLegacyRoot() {
const container = {
rootID: '' + idCounter++,
pendingChildren: [],
children: [],
};
const fiberRoot = NoopRenderer.createContainer(
container,
LegacyRoot,
false,
null,
);
return {
_Scheduler: Scheduler,
render(children: ReactNodeList) {
NoopRenderer.updateContainer(children, fiberRoot, null, null);
},
getChildren() {
return getChildren(container);
},
getChildrenAsJSX() {
return getChildrenAsJSX(container);
},
};
},

getChildrenAsJSX(rootID: string = DEFAULT_ROOT_ID) {
const container = rootContainers.get(rootID);
return getChildrenAsJSX(container);
Expand Down

0 comments on commit 8dea154

Please sign in to comment.