Skip to content

On first render, getting "Error: Rendered more hooks than during the previous render" -- fixed on reset and next load #2441

Discussion options

You must be logged in to vote

The problem likely exists elsewhere in your code. Unfortunately, I can't see anything obviously wrong here.

Thanks for your response i have solved it actually i was use useEffect hook after return statement which as cause this error

if (isLoading) {
return
}

if (error) {
return
}

At here
useEffect(() => {
console.log("isEdit: ",isEdit);
if (isEdit) {
setFormData({
subject: editData?.subject,
message: editData?.message,
})
}
}, [isEdit])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abdulmateentechbits
Comment options

Answer selected by frankcalise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants