[0.65] [iOS] Redbox displayed as well as LogBox
See original GitHub issueDescription
In 0.65 on iOS, RedBox is displayed as well as LogBox when using console.error or throwing an Error.
React Native version:
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 84.11 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.15.0 - ~/.nvm/versions/node/v14.15.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.15.0/bin/yarn
npm: 7.5.4 - ~/.nvm/versions/node/v14.15.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6241897
Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
Languages:
Java: 11.0.6 - /usr/local/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.65.1 => 0.65.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
npx react-native init Test --version 0.65.1
- Open up
App.js
and add the following to App component:const App: () => Node = () => { const isDarkMode = useColorScheme() === 'dark'; console.error('hello'); // <-- Add this here const backgroundStyle = { backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, };
- run
yarn start
andyarn ios
Expected Results
I expect to only see the error in LogBox at the bottom of the screen as in 0.64.2:
Actual Results
I get the Error in Redbox as well (Note that this is only an issue on iOS):
This also happens when throwing an Error, however it isn’t as much of an issue as LogBox is displayed in full screen in this case anyway.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Announcing React Native 0.63 with LogBox
LogBox is a completely redesigned redbox, yellowbox, and logging experience in React Native. In 0.62 we introduced LogBox as an opt-in.
Read more >Blog · React Native
LogBox is a completely redesigned redbox, yellowbox, and logging experience in React Native. In 0.62 we introduced LogBox as an opt-in.
Read more >How do you hide the warnings in React Native iOS simulator?
According to React Native Documentation, you can hide warning messages by setting disableYellowBox to true like this: console.disableYellowBox = true; ...
Read more >REDBOX: Rent, Stream & Buy 12+ - App Store
Download REDBOX: Rent, Stream & Buy and enjoy it on your iPhone, iPad, ... you could not see what was on the screen...
Read more >@react-native-community/eslint-plugin | Yarn - Yarn
... ReactHorizontalScrollViewManager (deec1db9fd) and update ScrollView.js (a54cfb9e57) and reach parity with iOS (04184ef851) by @mdvacca; Show Redbox for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, I forgot to post in here.
I believe I’ve found the original cause for this issue and I’ve raised a PR for the fix: https://github.com/facebook/react-native/pull/32641
If you want to fix it locally, in advance of the PR being released, it’s a one-line change you could use patch-package to apply.
@anthowm This could work as a workaround for now although one thing to note with this is that it also disables LogBox for console.errors.