Installation
note
React 17+ is a peer dependency. There is no need to install anything if React is already present. If React is not present in the project, use-pq
won't be able to run.
- NPM
- Yarn
- pnpm
npm install use-pq
yarn add use-pq
pnpm add use-pq
Dependencies
use-pq
itself only has lodash.set
as a dependency, which the perfect balance between stability and size for deep-setting properties.
Bundle Size
use-pq
only brings itself. Counting React as a peer dependency would make the package significantly larger, but by itself, it loads 8kB, which is roughly equivalent to 8 000 characters. One of the reasons to try to keep the package as small as possible is so that incremental adoption does not feel like a binary option. use-pq
can be used for pages where the query may be updated relatively often, while stable views can use GraphQL Code Generator against a static query.