I want to set a state and sometimes I want to do something after that and sometimes not!
how can I do that with hooks?
sometimes I want to call a function or do something after setting that:
this.setState({inputValue:'someValue'},()=>{
//do something
})
but sometimes not
this.setState({inputValue:'someAnotherValue'})
then I couldn't use of useEffect like this because I don't want to do something after setting that all the time:
useEffect(()=>{
//do something
},[inputValue])
useEffect(() => {
if(inputValue == someValue){
//do something
}
}, [inputValue])