| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | import * as React from 'react'; |
| 11 | import styles from './shared.css'; |
| 12 | |
| 13 | type Props = { |
| 14 | callStack: string | null, |
| 15 | children: React$Node, |
| 16 | componentStack: string | null, |
| 17 | errorMessage: string | null, |
| 18 | }; |
| 19 | |
| 20 | export default function UnsupportedBridgeOperationView({ |
| 21 | callStack, |
| 22 | children, |
| 23 | componentStack, |
| 24 | errorMessage, |
| 25 | }: Props): React.Node { |
| 26 | return ( |
| 27 | <div className={styles.ErrorBoundary}> |
| 28 | {children} |
| 29 | <div className={styles.ErrorInfo}> |
| 30 | <div className={styles.HeaderRow}> |
| 31 | <div className={styles.ErrorHeader}> |
| 32 | {errorMessage || 'Bridge protocol mismatch'} |
| 33 | </div> |
| 34 | </div> |
| 35 | <div className={styles.InfoBox}> |
| 36 | An incompatible version of <code>react-devtools-core</code> has been |
| 37 | embedded in a renderer like React Native. To fix this, update the{' '} |
| 38 | <code>react-devtools-core</code> package within the React Native |
| 39 | application, or downgrade the <code>react-devtools</code> package you |
| 40 | use to open the DevTools UI. |
| 41 | </div> |
| 42 | {!!callStack && ( |
| 43 | <div className={styles.ErrorStack}> |
| 44 | The error was thrown {callStack.trim()} |
| 45 | </div> |
| 46 | )} |
| 47 | </div> |
| 48 | </div> |
| 49 | ); |
| 50 | } |