SHARE
TWEET

axios.js

rizkyalviandra Feb 27th, 2020 (edited) 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const [data, setData] = React.useState({images_group:[], categories: [0]})
  2.  
  3. const getCategoryData = async () => {
  4.             const result = await axios(
  5.                 `http://api.com/api/product?categoryId=${data.categories[0].categoryId}`
  6.             )
  7.             setDataCategory(result.data)
  8.             console.log("product category", result.data)
  9.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top