/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-dom/src/test-utils/ReactTestUtils.js
23 строки
666 B
Josh Story
[TestUtils] Build limited test-utils (#28782)
08 апр 2024, 22:27
Не верифицирован
08 апр 2024, 22:27
01bb3c5
Код
Авторство
О чём код?
/** * 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. * * @noflow */ import * as React from 'react'; let didWarnAboutUsingAct = false; export function act(callback) { if (didWarnAboutUsingAct === false) { didWarnAboutUsingAct = true; console.error( '`ReactDOMTestUtils.act` is deprecated in favor of `React.act`. ' + 'Import `act` from `react` instead of `react-dom/test-utils`. ' + 'See https://react.dev/warnings/react-dom-test-utils for more info.', ); } return React.act(callback); }