react-native-firebase/bridge/app.js

40 lines
782 B
JavaScript
Raw Normal View History

2018-03-23 13:40:07 +00:00
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
2018-03-24 02:02:59 +00:00
// must import before all else
2018-03-23 13:40:07 +00:00
import React, { Component } from 'react';
2018-03-24 02:02:59 +00:00
import { AppRegistry, Text, View } from 'react-native';
2018-03-23 13:40:07 +00:00
import bridge from 'bridge/platform/react-native';
import firebase from 'react-native-firebase';
2018-03-23 22:18:19 +00:00
require('sinon');
require('should-sinon');
require('should');
2018-03-23 22:18:19 +00:00
class Root extends Component {
2018-03-23 13:40:07 +00:00
constructor(props) {
super(props);
2018-03-24 06:31:04 +00:00
this.state = {
message: '',
2018-03-24 06:31:04 +00:00
};
bridge.setBridgeProperty('root', this);
bridge.setBridgeProperty('module', firebase);
2018-03-23 13:40:07 +00:00
}
2018-03-23 22:18:19 +00:00
render() {
2018-03-23 13:40:07 +00:00
return (
2018-03-23 22:18:19 +00:00
<View>
<Text testID="messageText">{this.state.message}</Text>
2018-03-23 13:40:07 +00:00
</View>
);
}
}
2018-03-23 22:18:19 +00:00
AppRegistry.registerComponent('testing', () => Root);