1.3.3 • Published 5 years ago

uni-hook v1.3.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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

1.3.3

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago