Lint and compiler

exhaustive-deps

Keep reactive values used by an effect in its dependency list. If the effect is unnecessary, remove it rather than suppressing the warning.

Formal Syntax & Structure

react syntaxreact
react-hooks/exhaustive-deps

Working Example

Example Snippetreact
import {useEffect} from 'react';export default function App({zone,subscribe}){useEffect(()=>subscribe(zone),[zone,subscribe]);return <p>{zone}</p>}
React Reference