Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
isConcurrent = true;
}
}
let container = {
children: [],
createNodeMock,
tag: 'CONTAINER',
};
let root: FiberRoot | null = createContainer(
container,
isConcurrent ? ConcurrentRoot : LegacyRoot,
false,
null,
);
invariant(root != null, 'something went wrong');
updateContainer(element, root, null, null);
const entry = {
_Scheduler: Scheduler,
root: undefined, // makes flow happy
// we define a 'getter' for 'root' below using 'Object.defineProperty'
toJSON(): Array | ReactTestRendererNode | null {
if (root == null || root.current == null || container == null) {
return null;
}
if (container.children.length === 0) {
return null;
}
if (container.children.length === 1) {
return toJSON(container.children[0]);
}
update(newElement: React$Element) {
if (root == null || root.current == null) {
return;
}
updateContainer(newElement, root, null, null);
},
unmount() {
unmount() {
if (root == null || root.current == null) {
return;
}
updateContainer(null, root, null, null);
container = null;
root = null;
},
getInstance() {