veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

47
active users

#conform

0 posts0 participants0 posts today

Tinkering with the Conform library with Remix/React Router v7, it was not obvious to me how to return a proper HTTP status code like 422 Unprocessable Content for invalid form data.

This worked:

if (submission.status !== "success") {
return data(submission.reply(), { status: 422 });
}

Took some detours to figure out:

- just returning submission.reply() gives you "200 OK", which is not OK
- json() is deprecated so use data() instead
- trying Zod with data() but without Conform got to a weird place with types