bro useEffect to update a component’s state when some props or state change is not good useEffect only when fetch data from network read this docs https://react.dev/learn/you-might-not-need-an-effect