/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v19.0.0
packages/react/src/ReactOwnerStack.js
24 строки
735 B
Sebastian Markbåge
Remove top stack frame from getCurrentStack (#30306)
12 июл 2024, 01:34
Не верифицирован
12 июл 2024, 01:34
433068e
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, 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. * * @flow */ import {enableOwnerStacks} from 'shared/ReactFeatureFlags'; import ReactSharedInternals from 'shared/ReactSharedInternals'; export function captureOwnerStack(): null | string { if (!enableOwnerStacks || !__DEV__) { return null; } const getCurrentStack = ReactSharedInternals.getCurrentStack; if (getCurrentStack === null) { return null; } // The current stack will be the owner stack if enableOwnerStacks is true // which it is always here. Otherwise it's the parent stack. return getCurrentStack(); }