I am trying to convert a simple React component with a this.setstate callback to a functional component with useState/useEffect but i cant reproduce same functionality with latt