Files
react/compiler/forget/scripts/jest/setupEnvE2E.js
T
Joseph Savona a7450572fa import runtime from "React.unstable_ForgetRuntime"
Imports the runtime from `React.unstable_ForgetRuntime` rather than from a 
separate module. The hope is that any code that gets transformed already has a 
dependency on React anyway, so we can avoid adding a new dependency that other 
systems don't know about. 

While here, i also cleaned up the `guardThrows` flag (we still parse it if 
present and warn, rather than throwing, to make it easier to adopt the latest 
version in various places).
2022-10-21 09:13:37 -07:00

12 lines
407 B
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require("react");
const ForgetRuntime = require("../../packages/react-forget-runtime");
React.unstable_ForgetRuntime = ForgetRuntime;
React.unstable_useMemoCache = ForgetRuntime.unstable_useMemoCache;