Why nextjs useEffect firing every time i route

I have a useEffect function in the layout component, fetch my userData and store it … Read more Why nextjs useEffect firing every time i route

I have a useEffect function in the layout component, fetch my userData and store it in redux-store but its firing every time I route and I see this is not right with sending more useless requests to the server

I want the useFffect function run the first time and don’t triggers again when I route

Source: JavaSript – Stack Overflow


Categories: NewsTags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *