I have created this simple form which I handle in my LiveView component. What is the communities best practice for clearing / resetting my form after I submit this?
I do want to take validations etc. into account. Is this then always via an Ecto.Changeset, even when no schema is backing a form directly?
def handle_event("add", %{"text" => text}, socket) do
IO.inspect(text)
{:noreply, socket}
end
def render(assigns) do
~H"""
<form phx-submit="add">
<input type="text" name="text" placeholder="What needs to be done?" autofocus>
<input type="submit" />
</form>
"""
end