title: React Hook useCallback has a missing dependency:
body: <p>Hello i'm getting this :</p>
  <blockquote>
  <p>Line 82:5:   React Hook useCallback has a missing dependency:
  'product'. Either include it or remove the dependency array. You can
  also do a functional update 'setProduct(p =&gt; ...)' if you only need
  'product' in the 'setProduct' call  react-hooks/exhaustive-deps   Line
  95:5:   React Hook useCallback has a missing dependency: 'product'.
  Either include it or remove the dependency array. You can also do a
  functional update 'setProduct(p =&gt; ...)' if you only need 'product' in
  the 'setProduct' call  react-hooks/exhaustive-deps</p>
  </blockquote>
  <p>this is my product state :</p>
  <pre><code> const [product, setProduct] = useState({
      sku: &quot;&quot;,
      description: &quot;&quot;,
      unisex: true,
      woman: false,
      man: false,
      styles: [],
      materials: [],
      selectedFilesImages: [],
      selectedFilesVideos: [],
      name: &quot;&quot;,
      discountPrice: &quot;&quot;,
      categories: [],
      defaultPicture: [],
      shop: 0,
      variants: [],
      price: &quot;&quot;,
    });
  </code></pre>
  <p>Here are my two functions that use useCallBack</p>
  <pre><code> const addSelectedFilesImages = useCallback(
      (files) =&gt; {
        setProduct({ ...product, selectedFilesImages: files });
        console.log(product.selectedFilesImages);
      },
      [product.selectedFilesImages]
    );
  
    const addSelectedFilesVideos = useCallback(
      (files) =&gt; {
        setProduct({ ...product, selectedFilesVideos: files });
        console.log(product.selectedFilesVideos);
      },
      [product.selectedFilesVideos]
    );
  </code></pre>
  <p>here is my component to which i pass these functions</p>
  <pre><code>          &lt;div className=&quot;col-sm-6&quot;&gt;
                &lt;FileManger
                  addSelectedFiles={addSelectedFilesImages}
                  selectFiles={product.selectedFilesImages}
                  acceptFormat=&quot;image/*&quot;
                  videoOrPics=&quot;Drop files here or click to upload.&quot;
                /&gt;
              &lt;/div&gt;
              &lt;div className=&quot;col-sm-6&quot;&gt;
                &lt;FileManger
                  addSelectedFiles={addSelectedFilesVideos}
                  selectFiles={product.selectedFilesVideos}
                  acceptFormat=&quot;video/*&quot;
                  videoOrPics=&quot;Drop video files here or click to upload.&quot;
                /&gt;
              &lt;/div&gt;
  </code></pre>
  <p>If i put product in the dependency everytime product is updated also FileManger is rendered , FileManager is based on product.selectedFilesVideos or product.selectedFilesImages</p>