DEV Community

Discussion on: Web3 Tutorial: build DApp with Web3-React and SWR

 
yakult profile image
fangjun

you can console.log to see the output:

add a line :
console.log(await retrieving.retrieve())

Thread Thread
 
wenthebondsfail profile image
ThetaKing

Oh I see. It is giving me:

"Error: Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead."

will try to find out what can be done (if you know and can answer, will be very grateful). Thanks a lot!

Thread Thread
 
yakult profile image
fangjun • Edited

good direction.

a suggestion: try to decouple two kind of jobs

  • interact with smart contract (just as a traditional restful API) to get/set data correctly
  • render react page and components with data