React Hooks: useEffect() is called twice even if an empty array is used as an argument
Put the console.log inside the useEffect Probably you have other side effects that cause the component to rerender but the useEffect itself will only be called once. You can see this for sure with the following code. useEffect(()=>{ /* Query logic */ console.log(‘i fire once’); },[]); If the log “i fire once” is triggered more … Read more