yellowbox-react

YellowBox renders warnings at the bottom of the app being developed.

  • 所有者: iamdustan/yellowbox-react
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

React YellowBox

This is a direct port of React Native’s YellowBox developer tool to React.js.
Original source can be viewed at:
https://github.com/facebook/react-native/blob/master/Libraries/ReactIOS/YellowBox.js

YellowBox renders warnings at the bottom of the app being developed.

Warnings help guard against subtle yet significant issues that can impact the
quality of the app. This "in your face" style of warning allows developers to
notice and correct these issues as quickly as possible.

By default, the warning box is enabled when the NODE_ENV is not 'production'.
Set the following flag to disable it (and call console.warn to update any
rendered ):

  console.disableYellowBox = true;
  console.warn('YellowBox is disabled.');

Warnings can be ignored programmatically by setting the array:

  console.ignoredYellowBox = ['Warning: ...'];

Strings in console.ignoredYellowBox can be a prefix of the warning that
should be ignored.

Example Usage

import React from 'react';
import ReactDOM from 'react-dom';
import YellowBox from 'yellowbox-react';
import App from './your-app.js';

// ignore HMR (hot module replacement) warnings
console.ignoredYellowBox = ['[HMR]'];

ReactDOM.render((
  <div>
    <App />
    <YellowBox />
  </div>
), document.getElementById('app'));

Example Usage with React Blessed

import React from 'react';
import ReactBlessed from 'react-blessed';
import YellowBox from 'yellowbox-react/lib/blessed';
import blessed from 'blessed';

const screen = blessed.screen({
  autoPadding: true,
  smartCSR: true,
  title: 'react-blessed yellowbox',
});

screen.key(['escape', 'q', 'C-c'], function(ch, key) {
  return process.exit(0);
});

ReactBlessed.render((
  <element>
    <App />
    <YellowBox />
  </element>
), screen));

License

Copyright (c) 2015 Dustan Kasten, dustan.kasten@gmail.com
Licensed under the MIT license.

主要指標

概覽
名稱與所有者iamdustan/yellowbox-react
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證
所有者活动
創建於2015-12-01 19:00:09
推送於2019-08-18 17:42:08
最后一次提交2018-03-14 09:10:53
發布數6
最新版本名稱v0.10.0 (發布於 2017-05-02 09:40:13)
第一版名稱0.9.0 (發布於 2015-12-01 14:00:58)
用户参与
星數67
關注者數2
派生數8
提交數18
已啟用問題?
問題數2
打開的問題數1
拉請求數6
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?