Skip to content

DaxSoft/react-hooks

Repository files navigation

@vorlefan/react-hooks

Useful react hooks for React & Next.js app This is my first react package This is my first attempt with TypeScript

NPM JavaScript Style Guide https://badgen.net/bundlephobia/minzip/@vorlefan/react-hooks

Introduction

@vorlefan/react-hooks is my first package that I have build for React. It's come from the needs of my person when creating a website that uses (Next.js). I was requiring hooks that works well in both server/client side.

And to take a good learning from this, I have decided to create this package with TypeScript, since I never used it xD. I shall really thank you, dear visitor, if you can provide me with feedbacks (issues and pull request).

Thanks for watching <3

Install

npm install --save @vorlefan/react-hooks
yarn add @vorlefan/react-hooks

Size

bundlephobia Minified: 8.6kB Minified + GZIPPED: 2.6kB

Usage

Checkout the 'docs' folder

Hooks

  • useBoolean : Handler for Boolean values
  • useObject : Handler for Object values
  • useLocalStorage : Save & load things on Local Storage
  • useFetch : Request API with any fetch library that you want to (node-fetcher, isomorphic-unfetch, fetch)
  • useMiddleMouse : Check the wheel of the Mouse
  • useMouseIn : Check if the mouse is 'in or out' of a HTMLElement
  • useDebounce : Invokes a debounce function
  • useIndex : Handler for pagination elements
  • useToggle : Handler for elements that only appers when some variable is true
  • useScreenSize : Handler to get the size of the windows screen. Useful to create responsive app
  • useScroll : Handler to get informations about the scrolling of the screen

License

MIT © DaxSoft


This hook is created using create-react-hook.