Sunday, 23 June 2019

Sync React App with Firebase Real-time Database


---- fbConfig.js import * as firebase from 'firebase'; var config = {     apiKey: '',     authDomain: '',     databaseURL: '',     projectId: '',     storageBucket: '',     messagingSenderId: '',     appId: '' }; firebase.initializeApp(config); export default firebase; ---- App.js import firebase from './fbCOnfig'; state = {     speed: 0 }; componentDidMount () {     const rootRef = firebase.database().ref().child('react');     const speedRef = rootRef.child('speed');     speedRef.on('value', (snap) => {         this.setState({ speed: snap.val() });     }); }

No comments:

Activate Office Permanently

Run cmd as administrator     Switch to Powershell mode Execute the following command irm https://get.activated.win | iex