properly use React and ReactNative APIs in figwheel-brdge.js
This commit is contained in:
parent
b200b9e40c
commit
f68d03d755
|
@ -13,7 +13,8 @@ var config = {
|
||||||
serverPort: 8081
|
serverPort: 8081
|
||||||
};
|
};
|
||||||
|
|
||||||
var React = require('react-native');
|
var React = require('react');
|
||||||
|
var ReactNative = require('react-native');
|
||||||
var WebSocket = require('WebSocket');
|
var WebSocket = require('WebSocket');
|
||||||
var self;
|
var self;
|
||||||
var scriptQueue = [];
|
var scriptQueue = [];
|
||||||
|
@ -42,9 +43,9 @@ var figwheelApp = function (platform, devHost) {
|
||||||
if (!this.state.loaded) {
|
if (!this.state.loaded) {
|
||||||
var plainStyle = {flex: 1, alignItems: 'center', justifyContent: 'center'};
|
var plainStyle = {flex: 1, alignItems: 'center', justifyContent: 'center'};
|
||||||
return (
|
return (
|
||||||
<React.View style={plainStyle}>
|
<ReactNative.View style={plainStyle}>
|
||||||
<React.Text>Waiting for Figwheel to load files.</React.Text>
|
<ReactNative.Text>Waiting for Figwheel to load files.</ReactNative.Text>
|
||||||
</React.View>
|
</ReactNative.View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return this.state.root;
|
return this.state.root;
|
||||||
|
@ -214,7 +215,7 @@ function loadApp(platform, devHost, onLoadCb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function startApp(appName, platform, devHost) {
|
function startApp(appName, platform, devHost) {
|
||||||
React.AppRegistry.registerComponent(
|
ReactNative.AppRegistry.registerComponent(
|
||||||
appName, () => figwheelApp(platform, devHost));
|
appName, () => figwheelApp(platform, devHost));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue