mirror of
https://github.com/facebook/react.git
synced 2026-02-26 05:35:21 +00:00
chore[react-devtools]: add global for native and use it to fork backend implementation (#30533)
Adding `__IS_NATIVE__` global, which will be used for forking backend implementation. Will only be set to `true` for `react-devtools-core` package, which is used by `react-native`. Ideally, we should name it `react-devtools-native`, and keep `react-devtools-core` as host-agnostic. With this change, the next release of `react-devtools-core` should append component stack as Error object, not as string, and should add `(<anonymous>)` suffix to component stack frames.
This commit is contained in:
@@ -30,7 +30,7 @@ export function describeBuiltInComponentFrame(name: string): string {
|
||||
}
|
||||
}
|
||||
let suffix = '';
|
||||
if (__IS_CHROME__ || __IS_EDGE__) {
|
||||
if (__IS_CHROME__ || __IS_EDGE__ || __IS_NATIVE__) {
|
||||
suffix = ' (<anonymous>)';
|
||||
} else if (__IS_FIREFOX__) {
|
||||
suffix = '@unknown:0:0';
|
||||
|
||||
Reference in New Issue
Block a user