/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-devtools-shared/src/devtools/views/ErrorBoundary/SuspendingErrorView.js
49 строк
1 KB
Andrew Clark
[Codemod] Update copyright header to Meta (#25315)
18 окт 2022, 18:19
Не верифицирован
18 окт 2022, 18:19
9cdf8a9
Код
Авторство
О чём код?
/** * 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. * * @flow */ import * as React from 'react'; import {findGitHubIssue} from './cache'; import UpdateExistingIssue from './UpdateExistingIssue'; import ReportNewIssue from './ReportNewIssue'; import WorkplaceGroup from './WorkplaceGroup'; type Props = { callStack: string | null, componentStack: string | null, errorMessage: string | null, }; export default function SuspendingErrorView({ callStack, componentStack, errorMessage, }: Props): React.Node { const maybeItem = errorMessage !== null ? findGitHubIssue(errorMessage) : null; let GitHubUI; if (maybeItem != null) { GitHubUI = <UpdateExistingIssue gitHubIssue={maybeItem} />; } else { GitHubUI = ( <ReportNewIssue callStack={callStack} componentStack={componentStack} errorMessage={errorMessage} /> ); } return ( <> {GitHubUI} <WorkplaceGroup /> </> ); }