Hooks

useEffect

Declare client-side synchronization of a committed component with an external resource.

Formal Syntax & Structure

react syntaxreact
useEffect(setup, dependencies?)

Working Example

Example Snippetreact
useEffect(() => clock.subscribe(onTick), [onTick]);
React Reference