Git Product home page Git Product logo

usehooks-ts's Introduction

usehooks-ts banner


usehooks-ts

React hook library, ready to use, written in Typescript.

Netlify Status Open Source? Yes! Maintained License lerna npm bundle size npm All Contributors


npm i usehooks-ts

Created by Julien Caron and maintained with ❀️ by an amazing team of developers.

πŸ€” About

Initially, usehooks-ts was a Gatsby powered blog hosted with Github & netlify that publishes easy to understand React Hook code snippets.

But now, it's a monorepo containing:

  • A static website used as hooks documentation (Link).
  • An NPM package containing the hooks library (Link).

If you'd like to submit new post ideas, improve existing posts, or change anything about the website feel free to submit an issue or pull-request.

πŸ“– Summary

Usage

install

npm i usehooks-ts

Then go to the documentation.

🀝 How to Contribute

Thanks for wanting to contribute! It's more than welcome πŸ€—

Content changes

Most content changes (like fixing a typo) can be made without cloning the repository. Simply locate the file you wish to change in the GitHub UI, and click the little edit icon to make your change directly on the GitHub website.

If you need to make any other substantial changes, then follow the project setup steps below.

Fork to submit a Pull Request (PR)

This project use npm Lerna and npm@8 to manage the different packages. Before starting, make sure you have the good system dependencies:

Note: To easily switch node version, consider Node Version Manager (nvm).

Then you can fork, download and install the repository:

# 1) Fork the repository (button in the Github top-right corner)

# 2) Clone the repository
git clone https://github.com/{your_username}/usehooks-ts.git
cd usehooks-ts

# 3) Install dependencies and setup
npm run bootstrap

Create or update a new hook

# This command generates boilerplate for new hooks.
# Skip if updating an existed hook.
npm run plop

# Then develop the hook (aka test:watch)
npm run dev:lib

# Once the hooks is ready
# Launch the documentation website
npm run dev:site

# Before commit: exec types-checking, linters and tests
npm run test

How is structured a hook ?

The hook itself and its unit tests are in the /lib/src/ folder. It's the strict npm run test

πŸ“‚ lib/src
β”œβ”€β”€ πŸ“‚ useHookName
β”‚  β”œβ”€β”€ πŸ“„ index.ts # used for exports
β”‚  β”œβ”€β”€ πŸ§ͺ useHookName.test.ts # unit tests
β”‚  └── πŸ“„ useHookName.ts # the hook
...

The rest is in the documentation website:

πŸ“‚ site/src/hooks-doc
β”œβ”€β”€ πŸ“‚ useHookName
β”‚  β”œβ”€β”€ πŸ“„ index.ts # used for exports
β”‚  β”œβ”€β”€ πŸ“„ useHookName.demo.tsx # working demo
β”‚  └── πŸ“ useHookName.mdx # the documentation content
...

Note: The demo is used different way:

  • It's displayed on the website to illustrate how to use the hook.
  • It's displayed as an interactive sandbox in the hook page during the dev.
  • It's deployed as a CodeSandbox on build to let final users play with.

✨ Contributors

Big thanks goes to these wonderful people ❀️


Julien

πŸ–‹ πŸ’» 🎨 πŸ€”

a777med

πŸ’»

Nguyen Tien Dat

πŸ’»

Elias Cohenca

πŸ–‹

JoΓ£o Deroldo

πŸ› πŸ’»

Nishit

πŸ’»

Jon Koops

πŸ’»

LoneRifle

πŸ’»

Viktor

πŸ€” πŸ›

Bruno Clermont

πŸ’¬

yoannesbourg

πŸ€”

Strange2x

πŸ€”

Jason Pickens

πŸ›

Sel-Vin Kuik

πŸ›

isaac

πŸ›

Bruno RZN

πŸ’» πŸ‘€

Nathan Manceaux-Panot

πŸ’» πŸ‘€

Dien Vu

πŸ€”

Oleg Kusov

πŸ€”

Matthew Guy

πŸ€”

andrewbihl

πŸ›

lancepollard

πŸ›

Mukul Bansal

πŸ›

Jean-Luc Mongrain sur la Brosse

πŸ’» πŸ€”

Nic

πŸ–‹

Dan Wood

πŸ’»

jo wendenbuerger

πŸ›

Andrew Nosenko

πŸ›

CharlieJhonSmith

πŸ’»

Sullivan SENECHAL

πŸ€” πŸ›

Jason Long

πŸ›

kxm766

πŸ›

Quentin

πŸ’» πŸ€” πŸ–‹

Daniel Lazar

πŸ’» πŸ›

Mark Terrel

πŸ› πŸ’»

Andreas Herd

πŸ›

Sonjoy Datta

πŸ’»

Ilya Belsky

πŸ›

James Barrett

πŸ’»

AbbalYouness

πŸ’»

didriklind

πŸ’»

hexp1989

πŸ’»

Alvaro Serrano

πŸ–‹

Egehan DΓΌlger

πŸ’»

PabloLION

πŸ› πŸ’»

David Sanchez

πŸ›

Ajay Raja

πŸ›

Andy Merskin

πŸ€”

Avirup Ghosh

πŸ’» πŸ›

Sanne WintrΓ©n

πŸ›

Alessandro

πŸ›

Andrey Tatarenko

πŸ›

Anton Rusak

πŸ›

Mahmood Bagheri

πŸ’»

Anver Sadutt

πŸ–‹

Bogdan Ailincai

πŸ’»

Simeon Griggs

πŸ›

Kepro

πŸ›

Jake Lippert

πŸ›

Tu Nguyen Anh

πŸ› πŸ’»

Luke Shiels

πŸ›

Sergei Kolyago

πŸ€”

Adham Akmal Azmi

πŸ›

Alek Kowalczyk

πŸ›

Sean Callahan

πŸ›

Joshua Bean

πŸ’»

Tim Zhao

πŸ›

Patrick

πŸ›

Bryce Dorn

πŸ’»

angusd3v

πŸ’»

Kevin Dai

πŸ’»

Gomes

πŸ’»

Davide Di Simone

πŸ›

Jack Herrington

πŸ’» πŸ›

This project follows the all-contributors specification (emoji key). Contributions of any kind welcome!

πŸš— Roadmap

  • Add more hooks
  • Develop automated tests for all hooks

πŸ“ License

This project is MIT licensed.

usehooks-ts's People

Contributors

a777med avatar angusd3v avatar anver avatar bogdanailincaipnt avatar brycedorn avatar createdbymahmood avatar danbiilee avatar datkira avatar dependabot[bot] avatar egehandulger avatar elifer5000 avatar hexp1989 avatar jamesbarrettdev avatar jaslong avatar jbean96 avatar jherr avatar joaoderoldo avatar jonkoops avatar juliencrn avatar kvdo2 avatar lgxm3z avatar lonerifle avatar n1c avatar nishit-dua avatar pablolion avatar qlaffont avatar renovate-bot avatar sonjoydatta avatar tuna-kai avatar yabbal avatar

Watchers

 avatar

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.