Search for a command to run...
Stateful Newsletter with Micro interactions
$ pnpm dlx shadcn@latest add https://vatsalrana.dev/r/newsletter.json
import Newsletter from "@/components/newsletter"
<Newsletter clearOnSuccess onSubmitAction={async (email) => { const response = await fetch("/api/v1/newsletter", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ email }), }) const data = await response.json() if (!response.ok) { throw new Error(data.message) } console.log(data) }} />