//useCallback is hook that return memorized version of callback function
//only changes when one of dependency is changed
import {useState,useCallback} from 'react'
const [increment,setIncrement]=useState(0)
const [otherCounter,setOtherCounter]=useState(0)
//useCallback(callback,dependencies)
const increment= useCallback(()=> {
setCount(count+1)
},[count])
const incrementOtherCounter= useCallback(()=> {
setOtherCounter(otherCounter+1)
},[otherCounter])