Fork me on GitHub

PSA: there are updated devcards + reagent docs:!/devdemos.reagent - thanks @bhauman!!

Pablo Fernandez07:10:47

What’s the best way to reset forms with uncontrolled inputs?


1. make them controlled 2. unmount the form component completely and mount it again somehow


another option is to add a type=reset button, see what happens


Does anyone have an example of how they're doing initial state setup? Say calling an API to get initial data?


I just create a go block in which I hit the API, with a callback that does nothing but change the value of a reagent ratom to match the returned value. Then any reagent components that deref the ratom will be rerendered appropriately once the value's returned.


Not sure if that answers your question; I'm not sure what you're after. Also disclaimer: I'm not a reagent guru at all, just a happy user of it simple_smile