A hook to add a lot of similar callbacks inside a React component
npm install use-callback-creator> A hook to add a lot of similar callbacks inside a React component
 
``bash`
npm install --save use-callback-creator
`jsx
import React, { useState } from 'react'
import useCallbackCreator from 'use-callback-creator'
const Example = () => {
const [counters, setCounter]=useState([0,0,0,0]);
const handleAdd = useCallbackCreator((index)=>{
const newCounters=[...counters];
newCounters[index]+=1;
setCounters(counters);
},[counters]);
return (
MIT © MarkEhr
---
This hook is created using create-react-hook.