I am trying to fetch a variable (avatar seed) from a database doing the following function:
async function getProfileData() {
let response = await post('/getProfileData', {
name: 'test'
})
return response
}
That works completely fine, the problem is that I need this seed to render in an element, but I am not sure how I would do that without the promise returns pending.
This is the element I am trying to add the seed to:
function Example() {
return (
<img src={`https://avatars.dicebear.com/api/croodles/${seed}.svg`} alt="Sprite"/>
)
}
export default Example;