Permalink
Browse files

RN: Revamp YellowBox for Warnings

Reviewed By: vjeux

Differential Revision: D2667624

fb-gh-sync-id: f3c6ed63f3138edd13e7fe283cf877d598018813
  • Loading branch information...
yungsters authored and facebook-github-bot-7 committed Nov 20, 2015
1 parent b641d3d commit 8ab51828ff077ae0ad10c06f62f9f01d58b9bf85
@@ -15,19 +15,20 @@
*/
'use strict';
var React = require('react-native');
var {
const React = require('react-native');
const {
StyleSheet,
Text,
View,
} = React;
var requireNativeComponent = require('requireNativeComponent');
var UpdatePropertiesExampleView = requireNativeComponent('UpdatePropertiesExampleView');
var FlexibleSizeExampleView = requireNativeComponent('FlexibleSizeExampleView');
const requireNativeComponent = require('requireNativeComponent');
class AppPropertiesUpdateExample extends React.Component {
render() {
// Do not require this unless we are actually rendering.
const UpdatePropertiesExampleView = requireNativeComponent('UpdatePropertiesExampleView');
return (
<View style={styles.container}>
<Text style={styles.text}>
@@ -45,6 +46,8 @@ class AppPropertiesUpdateExample extends React.Component {
class RootViewSizeFlexibilityExample extends React.Component {
render() {
// Do not require this unless we are actually rendering.
const FlexibleSizeExampleView = requireNativeComponent('FlexibleSizeExampleView');
return (
<View style={styles.container}>
<Text style={styles.text}>
@@ -60,7 +63,7 @@ class RootViewSizeFlexibilityExample extends React.Component {
}
}
var styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF',
Oops, something went wrong.

6 comments on commit 8ab5182

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Nov 21, 2015

Collaborator

Looks like we lost the commit message on this import, any details on what the impetus was / what improvements were made?

Collaborator

brentvatne replied Nov 21, 2015

Looks like we lost the commit message on this import, any details on what the impetus was / what improvements were made?

@brianreavis

This comment has been minimized.

Show comment
Hide comment
@brianreavis

brianreavis Nov 22, 2015

Also: require('sprintf') in this commit does not resolve

brianreavis replied Nov 22, 2015

Also: require('sprintf') in this commit does not resolve

@yungsters

This comment has been minimized.

Show comment
Hide comment
@yungsters

yungsters Nov 23, 2015

Contributor

Sorry, here is the original commit message.


Revamps the former WarningBox as the new YellowBox component with the following changes:

  • Default to enabled (in __DEV__) with a console.disableYellowBox flag to disable it.
  • Added a console.ignoreYellowBox property to ignore warnings by string suffix.
  • Now handles console.error calls with strings that start with Warning:.
  • Removed logic that persists the list of ignored warnings.
  • Displays only up to four warnings (before it requires scrolling).
  • Minor tweaks and polishes to the user interface.
  • Added support for React Native Android.

@brianreavis Thanks for the report and sorry for the breakage. 6b3a6e5 fixes this.

Contributor

yungsters replied Nov 23, 2015

Sorry, here is the original commit message.


Revamps the former WarningBox as the new YellowBox component with the following changes:

  • Default to enabled (in __DEV__) with a console.disableYellowBox flag to disable it.
  • Added a console.ignoreYellowBox property to ignore warnings by string suffix.
  • Now handles console.error calls with strings that start with Warning:.
  • Removed logic that persists the list of ignored warnings.
  • Displays only up to four warnings (before it requires scrolling).
  • Minor tweaks and polishes to the user interface.
  • Added support for React Native Android.

@brianreavis Thanks for the report and sorry for the breakage. 6b3a6e5 fixes this.

@MrPluto

This comment has been minimized.

Show comment
Hide comment
@MrPluto

MrPluto Dec 16, 2015

how to disable the yellowBox ?? why i release my iOS APP,(schema is release) ,and still have the yellowBox?

MrPluto replied Dec 16, 2015

how to disable the yellowBox ?? why i release my iOS APP,(schema is release) ,and still have the yellowBox?

@yungsters

This comment has been minimized.

Show comment
Hide comment
@yungsters

yungsters Dec 16, 2015

Contributor

It only appears if DEV is true. You can disable it by setting console.disableYellowBox = true;.

Contributor

yungsters replied Dec 16, 2015

It only appears if DEV is true. You can disable it by setting console.disableYellowBox = true;.

@MrPluto

This comment has been minimized.

Show comment
Hide comment
@MrPluto

MrPluto Dec 17, 2015

you mean it doesnt care what Xcode has setted release,it just care how you bundle your package ?

MrPluto replied Dec 17, 2015

you mean it doesnt care what Xcode has setted release,it just care how you bundle your package ?

Please sign in to comment.