replace require with es6 import in docs

Reviewed By: svcscm

Differential Revision: D2936839

fb-gh-sync-id: 7a921709a37de5e9aadf324d5438d51851326348
shipit-source-id: 7a921709a37de5e9aadf324d5438d51851326348
This commit is contained in:
Mateusz Zatorski
2016-02-14 15:02:39 -08:00
committed by facebook-github-bot-7
parent 2260d900d4
commit 3ae99d0fea
11 changed files with 35 additions and 38 deletions

View File

@@ -96,12 +96,12 @@ You need to run `adb reverse tcp:8081 tcp:8081` to forward requests from the dev
## Module that uses `WebSocket` (such as Firebase) throws an exception
React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through `require('react-native')`. If you load another module that requires WebSockets, be sure to load/require it after react-native.
React Native implements a polyfill for WebSockets. These polyfills are initialized as part of the react-native module that you include in your application through `import React from 'react-native'`. If you load another module that requires WebSockets, be sure to load/require it after react-native.
So:
```
var React = require('react-native');
var Firebase = require('firebase');
import React from 'react-native';
import Firebase from 'firebase';
```
Requiring firebase *before* react-native will result in a 'No transports available' redbox.