/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails oncall+recoil
* @flow strict-local
* @format
*/
'use strict';
import type {StoreID} from '../../core/Recoil_Keys';
const {
getRecoilTestFn,
} = require('recoil-shared/__test_utils__/Recoil_TestingUtils');
let React,
renderElements,
renderUnwrappedElements,
useEffect,
useRef,
reactMode,
act,
RecoilRoot,
useRecoilStoreID,
atom,
componentThatReadsAndWritesAtom,
useRecoilBridgeAcrossReactRoots;
const testRecoil = getRecoilTestFn(() => {
React = require('react');
({useEffect, useRef} = React);
({act} = require('ReactTestUtils'));
({reactMode} = require('../../core/Recoil_ReactMode'));
({
renderElements,
renderUnwrappedElements,
componentThatReadsAndWritesAtom,
} = require('recoil-shared/__test_utils__/Recoil_TestingUtils'));
({RecoilRoot, useRecoilStoreID} = require('../../core/Recoil_RecoilRoot'));
atom = require('../../recoil_values/Recoil_atom');
useRecoilBridgeAcrossReactRoots = require('../Recoil_useRecoilBridgeAcrossReactRoots');
});
function NestedReactRoot({children}) {
const ref = useRef();
const RecoilBridge = useRecoilBridgeAcrossReactRoots();
useEffect(() => {
renderUnwrappedElements(