Giter Club home page Giter Club logo

react-hooks-library's Introduction

React Hooks Library

Build Status Version License

A collection of hooks and utilities for React. List of all function. For more information, read the official documentation.

Features

  • ๐Ÿ”ฎ Typescript

    Written in typescript so you get the advantage of strong type safety

  • ๐Ÿง  Server Side Ready

    All hooks handle SSR rendering and work well with frameworks like Next/Gatsby

  • ๐ŸŒฟ Tree Shakable

    Exported as es modules, import cost for individual function is tiny

  • ๐ŸŽก Interactive Demos

    All hooks have a demo example to demonstrate their use

Installation

npm i @react-hooks-library/core
# or
yarn add @react-hooks-library/core
# or
pnpm add @react-hooks-library/core

Contribution

Contribution guide coming soon... ๐Ÿคž๐Ÿฝ

Credits

This library is heavily inspired by VueUse, from the vue ecosystem.

License

MIT ยฉ 2021 | Arpit

react-hooks-library's People

Contributors

cristianfigueredo avatar fernandoxu avatar heyitsarpit avatar reeywhaar avatar sapkra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-hooks-library's Issues

[docs] Design and Performance Improvements

  • Add button to open sidebar on mobile
  • make sidebar autocollpsible
  • close sidebar by clicking outside it
  • Make logo smaller on mobile, hide text logo on mobile
  • Higher margin y for code blocks
  • Lower x padding for body on mobile
  • Optimise font loading, use same origin font and caching via swr

[docs][packages] Build failure due to SSR not working

Various errors related to document and window being undefined. Happended after merging #13 .

Issues encountered in these functions -

  • BreakPointHooks
  • useActiveElement
  • useClickOutside
  • useEventListener
  • useKeyStroke
  • useMediaStream
  • useMutationObserver
  • useRouter
  • useScroll
  • useTitle
  • useWindowSize

[bug] Typescript error on build "ConnectionType"

Hello , I use your library for its BreakPointHooks and I have an issue when trying to build my app :

npm run build                  

> [email protected] build
> tsc && vite build

node_modules/@react-hooks-library/core/index.d.ts:627:21 - error TS2304: Cannot find name 'ConnectionType'.

627     readonly type?: ConnectionType;
                        ~~~~~~~~~~~~~~

node_modules/@react-hooks-library/core/index.d.ts:649:11 - error TS2304: Cannot find name 'ConnectionType'.

649     type: ConnectionType | undefined;
              ~~~~~~~~~~~~~~


Found 2 errors in the same file, starting at: node_modules/@react-hooks-library/core/index.d.ts:627

What could I do to fix it ? I'm using Typescript 5.3.3 on my app btw.

Thanks !

[hooks] Hooks don't return stable functions

Hooks don't currently return stable functions, i.e. the function is recreated on each render and cannot be properly used by user code inside an effect.

Solution - wrap all internal function with useCallback.

useMediaQuery returns updated value after 15px

i am using the useMediaQuery hook.
My code:

   const isDesktopScreen = useMediaQuery('(min-width: 1552px)')

the isDesktopScreen return false at 1537px instead of 1552px.
The useMediaQuery returns updated value after 15px is decreased or increased.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.