I encountered this problem building a webapp and I replicated it in this jsfiddle. Essentially, I would like an input to call this.setState({message: input_val})
this.setState({message: input_val})
with setState hook
useEffect(() => { your code... }, [yourState]);