sunny-green•3y ago
Get return value from Edit page
I want to get avatar value from Edit page and parse into the Avatar component
2 Replies
Hi @tads8799. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To get the avatar value from the Edit page and parse it into the Avatar component, you can use the
queryResult from the useForm hook provided by refine. The queryResult contains the data fetched from the API for the record being edited.
Here's how you can modify your code:
In this code, avatarData is the avatar value fetched from the API. This value is then used as the src prop for the Avatar component.
Please note that the actual path to the avatar data in the API response may vary depending on your API structure. You may need to adjust the avatarData extraction line accordingly.
For more information on the useForm hook and the queryResult it provides, you can refer to the refine documentation (https://refine.dev/docs/api-reference/antd/hooks/form/useForm/).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below