The react application that I'm working on triggers the userEffect function if the prop value changes from an empty array to another empty array.
I'm getting query params from the page and passing them down in a component that re-renders if any of the query param array changes. But the issue is that the useEffect function triggers and re-renders the component even if the query param array changed from [] to [].
I know that [] !== [], maybe that's what causing the issue. But is there a way that that the application can prevent triggering the useEffect function in the first place?
Heres a codesandbox demo: https://codesandbox.io/s/vibrant-greider-qgjgs?file=/src/App.js
useEffectto run? - jered[]to[]- Prottay Rudra['some-data'] to[]`. How do you handle that? - Prottay Rudra