Next.js Discord

Discord Forum

Error in the console

Answered
Persian posted this in #help-forum
Open in Discord
Original message was deleted.
Answered by Highlander
idk man im new to using next js , but pretty sure the problem was with state
View full answer

12 Replies

Highlander
i think you should change the dependency of useeffect from state to something else
Highlander
but then it should create a recursive loop for the useeffect ig
@Highlander but then it should create a recursive loop for the useeffect ig
Persian
So you mean the code i add in the useEffect of the changing of [state] is creating an infinie loop?
Highlander
yes cus the change is state triggers the useeffect and you change the state again
@Highlander yes cus the change is state triggers the useeffect and you change the state again
Persian
Solved the func but now getting this error
Highlander
idk man im new to using next js , but pretty sure the problem was with state
Answer
Highlander
in useeffect
@Persian can i ask why you deleted the post? it makes it harder for others to see the solution (ie making mark solution useless)
@Highlander idk man im new to using next js , but pretty sure the problem was with state
Persian
Hey im still getting same error even when i did remove the useEffect of that [state]