mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
a7450572fa
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).
12 lines
407 B
JavaScript
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;
|