I am trying to implement a clean-up function here. When I do it is not working. Can someone help me by modifying the codes, so that it will work?
useAsyncEffect(async () => {
if (!productNumber) return;
const res = await fetchProducts();
if (res === undefined) return;
setSelectedProduct(res.data);
}, [productNumber]);