DEV Community

Harit Himanshu
Harit Himanshu

Posted on

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

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)

Top comments (0)