snakeUni / uni-hook

🐢 custom react hook

Home Page:https://snakeuni.github.io/uni-hook/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uni-hook

custom hook for react

Install

yarn add uni-hook   or  npm install uni-hook

Usage

import { useCounter } from 'uni-hook'

function Counter() {
  const [count, { increment, incrementBy, decrement, decrementBy }] = useCounter(0)
  return (
    <div>
      <div className="mr-bt">Count: {count}</div>
      <Button onClick={() => increment()} className="Button">ι€δΈ€ι€’ε’ž</Button>
      <Button onClick={() => incrementBy(5)} className="mr-20 Button">ι€δΊ”ι€’ε’ž</Button>
      <Button onClick={() => decrement()} className="mr-20 Button">逐一递减</Button>
      <Button onClick={() => decrementBy(5)} className="mr-20 Button">逐五递减</Button>
    </div>
  )
}

All Hook

About

🐢 custom react hook

https://snakeuni.github.io/uni-hook/


Languages

Language:TypeScript 85.1%Language:JavaScript 13.9%Language:CSS 1.1%