T
TanStack3y ago
stormy-gold

How to render form fields based on result from an API call that uses value in previous form field ?

I have a form which requires and input domain. When domain is provided, I need to call and API and render other fields based on data received. I thought of using form.Subscribe and then using useEffect in children component, but that throws error.
4 Replies
like-gold
like-gold3y ago
What error does it throw? Maybe we can look into it?
stormy-gold
stormy-goldOP3y ago
Rendered more hooks than during the previous render. is the error
like-gold
like-gold3y ago
Can you show a full code sample by chance?
stormy-gold
stormy-goldOP3y ago
Okay. I'll try to isolate the code and provide you a codesandbox. Just curious to know, my approach is correct ? or is there any other way of doing this ? Maybe some issue on my end couldn't replicate.

Did you find this page helpful?