项目作者: tanhauhau

项目描述 :
Universal Reactotron for React Native and React
高级语言: JavaScript
项目地址: git://github.com/tanhauhau/reactotron-react.git
创建时间: 2017-07-26T14:28:07Z
项目社区:https://github.com/tanhauhau/reactotron-react

开源协议:

下载


reactotron-react

Universal Reactotron import for react-native and react-js

If you are writing universal app for both web and native, and wonder whether to import reactotron-react-native or reactotron-react-js, import reactotron-react then.
Under the hood, reactotron-react uses module import and file extensions to selectively import reactotron-react-native or reactotron-react-js based on the platform you are running on.

Getting started

  1. npm install --save-dev reactotron-react
  2. # or yarn
  3. yarn add reactotron-react

Usage

  1. // instead of
  2. import Reactotron from 'reactotron-react-js'
  3. Reactotron
  4. .configure() // we can use plugins here -- more on this later
  5. .connect() // let's connect!
  6. // or
  7. import Reactotron from 'reactotron-react-native'
  8. Reactotron
  9. .configure() // controls connection & communication settings
  10. .useReactNative() // add all built-in react native plugins
  11. .connect() // let's connect!
  12. // do
  13. import Reactotron from 'reactotron-react'
  14. Reactotron
  15. .configure()
  16. .useReactNative() // this will have no effect on react-js for web
  17. .connect()

Read more

Recommend

Watch this amazing talk leland richardson about writing universal react app for Android, iOS, web and more platforms.

thumbnail