react-firehooks
Version:
Lightweight dependency-free collection of React hooks for Firebase
73 lines (47 loc) • 2.4 kB
Markdown
[](https://www.npmjs.com/package/react-firehooks)
[](https://www.npmjs.com/package/react-firehooks)
[](https://bundlephobia.com/package/react-firehooks)
[](https://github.com/andipaetzold/react-firehooks/actions/workflows/push.yml?query=branch%3Amain)
[](https://github.com/andipaetzold/react-firehooks/blob/main/LICENSE)
[](https://github.com/semantic-release/semantic-release)
# React Firehooks 🔥🪝
Lightweight dependency-free collection of React hooks for Firebase.
## Installation
```sh
npm install react-firehooks
```
or
```sh
yarn add react-firehooks
```
## Compatibility
- [firebase](https://www.npmjs.com/package/firebase): 10.5.0 or later
- [react](https://www.npmjs.com/package/react): 16.8.0 or later
## Usage
[Type Documentation](https://andipaetzold.github.io/react-firehooks)
This library consists of 6 modules with many hooks:
- [`app-check`](docs/app-check.md)
- [`auth`](docs/auth.md)
- [`database`](docs/database.md)
- [`firestore`](docs/firestore.md)
- [`messaging`](docs/message.md)
- [`storage`](docs/storage.md)
All hooks can be imported from `react-firehooks` directly or via `react-firehooks/<module>` to improve tree-shaking and bundle size.
## Development
### Build
To build the library, first install the dependencies, then run `npm run build`.
```sh
npm install
npm run build
```
### Tests
To run the tests, first install the dependencies, then run `npm test`. Watch mode can be started with `npm test -- --watch`.
```sh
npm install
npm test
```
## Resources
### React Firebase Hooks
This library is heavily inspired by [`react-firebase-hooks`](https://www.npmjs.com/package/react-firebase-hooks). It was created because `react-firebase-hooks` seemed unmaintained and did not support Firebase v9 for a couple of months. `react-firehooks` is not a fork but a completely new code base exporting almost identical hooks.
## License
[MIT](LICENSE)