How to use useEffect inside map function?

前端 未结 2 1711
囚心锁ツ
囚心锁ツ 2021-01-27 23:15

I have two tables in Firebase: Vouchers & ClaimedVouchers. I am trying to display the vouchers that do not appear in the ClaimedVouchers table. So, I have a query that gets

2条回答
  •  暖寄归人
    2021-01-28 00:04

    Just to highlight how you can use isClaimed as hoook and set state calling a async function inside it. Later use the above hook in a react component. Please follow below sanbox.

    https://codesandbox.io/s/confident-cray-4g2md?file=/src/App.js

提交回复
热议问题