fm-react-firebase v4.0.0
React Firebase
The fastest and most efficient way to use Firebase in a React application
Fetch, add, and mutate Firestore data with zero boilerplate using provided
useDocanduseCollectionhooksThese Firestore hooks are built on top of SWR, meaning you get all of its awesome benefits out-of-the-box
Easily integrate Firebase Authentication into your app with zero boilerplate using the provided auth/render functions and
useAuthhookAuthentication state is automatically handled and maintained for you using RxJS under the hood
Getting Started
Simply install the package along with it's peer dependencies
yarn add fm-react-firebase firebase swror
npm install fm-react-firebase firebase swrFirestore Documents
Fetching a document is too easy with the useDoc hook
const { data } = useDoc("posts/some-doc-id");You can also use the same hook to update the document
const { set } = useDoc("posts/some-doc-id");
const updateDoc = async () => {
await set(dataToUpdate)
alert('Document was updated!')
}
return (
<button onClick={updateDoc}>Submit</submit>
)2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago