I managed to update a PRODUCT value from the database, but I want to get the value now in the interface, so the user will see exactly the value from the database.
So if I console.log ITEM, I’m getting undefined and then data show after it said undefined here are the logs:
Please help me to solve this issue.
2
Answers
U need to use async/await in your code which asynchronous operations like fetching data from a database which will give u the data once available
Define smartPhone as a state:
And return: