How do i fix react use effect running twice on refresh site
Answered
Orangetailed potter wasp posted this in #help-forum
Orangetailed potter waspOP
I am making a project in next using firebase and a FullCalendar. im using a use effect to render my calendar and its draggable components. for some rease the use effect runs twice, it is supposed to run once.
Answered by Wuchang bream
I often have this issue, but only in a dev environment. If your dependency array is not causing it, it may be fine in production.
5 Replies
Wuchang bream
I often have this issue, but only in a dev environment. If your dependency array is not causing it, it may be fine in production.
Answer
Orangetailed potter waspOP
Thanks
React renders twice in development when strict mode is set to true.
This is by design.
Giant panda