summaryrefslogtreecommitdiff
path: root/react/05-useeffect/README.md
blob: 86f65f51c94a1ef60d4c2f2e6ff764895d2bdd6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# useEffect Hook

## Code template

import { useEffect } from 'react';

useEffect(() => {
  // 1. Your side effect code goes here
  
  return () => {
    // 2. Optional cleanup code goes here
  };
}, [dependencies]); // 3. Optional dependency array

## Examples

Look at the src/App.jsx file.