title: Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'params')
body: <p>I am getting an error while showcasing single product on screen, the error is stated as-</p>
  <pre><code>Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'params')
  </code></pre>
  <p>The code which is causing the error is</p>
  <pre><code>function ProductScreen({ match }) {
    const [product, setProduct] = useState({})
  
    useEffect(() =&gt; {
      const fetchProduct = async () =&gt; {
        const { data } = await axios.get(`/api/products/${match.params.id}`)
  
        setProduct(data)
      }
  
      fetchProduct()
    }, [match])
  </code></pre>
  <p>I guess the error is of match.params.id, But I am having a hard time to resolve the error.Can anyone know the fix to this error?</p>