-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
39 lines (34 loc) · 1.04 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import firebase from 'firebase';
import ReduxThunk from 'redux-thunk';
import reducers from './src/reducers';
import Router from './src/Router';
class App extends Component {
componentWillMount() {
const config = {
apiKey: 'AIzaSyDDwlJMAIzKAEEcdWz22mnmh2qqhHZwJis',
authDomain: 'cardiary-feab7.firebaseapp.com',
databaseURL: 'https://cardiary-feab7.firebaseio.com',
projectId: 'cardiary-feab7',
storageBucket: '',
messagingSenderId: '360464485470'
};
firebase.initializeApp(config);
firebase.auth().signInAnonymously().catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
console.log(errorCode, errorMessage);
});
}
render() {
const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));
return (
<Provider store={store} >
<Router />
</Provider>
);
}
}
export default App;