Firestore Data Provider for React Component
firestore-react
provides createContainer()
function (inspired by Meteor) which creates a HOC to provide Firestore data for your React Components.
Provides two things
- Fetches data and passes down to the presentational components
- Adds a subscriber to listen to live snapshot updates on the query and also removes the subscriber when component is unmounted.
Installation
yarn add firestore-react
Examples
Simple List - Source Code
import createContainer from 'firestore-react';
class App extends React.Component {
render() {
}
}
const AppWithData = createContainer(App, (db) => {
return {
users: db.collection('users')
}
})
Quick Demo
![Demo Firestore React bindings alt text](https://github.com/GeekyAnts/react-firestore/raw/HEAD/./examples/demo.gif)