sdr34 / react-hook-kit

React Hook Kit: A TypeScript library of reusable custom hooks for accelerating React application development.
MIT License
4 stars 3 forks source link

Development of useMediaQuery Hook for Managing Media Queries #24

Closed sdr34 closed 1 year ago

sdr34 commented 1 year ago

Description:

The aim of this issue is to develop a useMediaQuery custom hook in our codebase. This hook will provide a reusable method for interacting with CSS media queries, enabling more dynamic and responsive component rendering.

Details:

Currently, we lack a streamlined and reusable way to handle CSS media queries in our JavaScript code. Implementing a useMediaQuery hook will allow us to manage responsive behaviors more efficiently and directly within our components.

The expected behavior of this hook is:

Accept a CSS media query string as an input. Return a boolean indicating whether the media query is currently satisfied.

Tasks:

Develop the useMediaQuery hook according to the specifications. Write unit tests to ensure the hook functions as expected. Document the hook's functionality, usage, and provide examples. Ensure the hook is performant and does not cause unnecessary re-renders.

Acceptance Criteria:

The hook correctly evaluates media queries and returns the appropriate boolean value. The hook's behavior matches the specifications and it integrates well with the rest of our codebase. The hook is backed by comprehensive unit tests which pass. The hook is properly documented. The hook does not negatively impact app performance.