fetchData will be run and data will be provided to the return part of the component. However, I tried that and it results in a loop, the component keeps fetching data. Why?
On the second case, "validating input field", why not just validate inside of the inputHandler like this?
On the first case, "fetch API data", why not just fetchData? What's the use of useEffect?
fetchData will be run and data will be provided to the return part of the component. However, I tried that and it results in a loop, the component keeps fetching data. Why?
On the second case, "validating input field", why not just validate inside of the inputHandler like this?
this seems to work, what's the use of useEffect here?