I have a simple useEffect function setup with the brackets like so:
useEffect(() => {
console.log('hello')
getTransactions()
}, [])
However when I run my app, it prints two hellos in the console. Any idea why?
Even if I add something like this, two hellos print still.
const [useEffectCalled, setUseEffectCalled] = useState<Boolean>(false)
useEffect(() => {
console.log('hello')
if (!useEffectCalled) {
getTransactions()
}
setUseEffectCalled(true)
}, [])