Skip to content

snakeUni/uni-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

41 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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