Why useEffect warns for the fields that I do not need to put in the dependencies array?
Harit Himanshu

Harit Himanshu @harittweets

About: I am hands-on software professional with more than a decade of experience in building and shipping products at companies of small to large sizes. contributed in Advertising,CleanTech,Security,FinTech

Location:
Victoria, BC
Joined:
Sep 3, 2019

Why useEffect warns for the fields that I do not need to put in the dependencies array?

Publish Date: Apr 7 '20
2 0

I have gone through the useEffect documentation and I do not understand why I get warning for every variable and function that I use inside useEffect, but I have no dependency on them.

Consider my useEffect here

const [updatedComm, setUpdatedComm] = useState<ICommunication>(props.comm)
const [isEditOn, setIsEditOn] = useState<boolean | false>(false)

Comments 0 total

    Add comment