@dhananjaywarade/uida
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

UseCounter Hook

Creating a button component in React is made simple with this approach. You can also use hooks like useCounter to easily manage increment and decrement operations.

Demo

Demo GIF

Installation

Install my-project with npm

 npm i @dhananjaywarade/uida

Usage/Examples

import { useCounter,Button} from "@dhananjaywarade/uida";


function App() {
  const {count,increment,decerement} = useCounter();

  return (
    <>
    <Button onclick={increment}>+</Button>
     <h1>{count}</h1>
     <Button onclick={decerement}>-</Button>
    </>
  )
}

export default App

Authors

/@dhananjaywarade/uida/

    Package Sidebar

    Install

    npm i @dhananjaywarade/uida

    Weekly Downloads

    1

    Version

    1.0.5

    License

    ISC

    Unpacked Size

    60.2 kB

    Total Files

    12

    Last publish

    Collaborators

    • dhananjaywarade