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:

208
active users

#reactrouter

0 posts0 participants0 posts today
Di<p>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.</p><p>This worked:</p><p>if (submission.status !== "success") {<br> return data(submission.reply(), { status: 422 });<br>}</p><p>Took some detours to figure out:</p><p>- just returning submission.reply() gives you "200 OK", which is not OK<br>- json() is deprecated so use data() instead<br>- trying Zod with data() but without Conform got to a weird place with types</p><p><a href="https://bne.social/tags/reactrouter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>reactrouter</span></a> <a href="https://bne.social/tags/conform" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>conform</span></a> <a href="https://bne.social/tags/zod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>zod</span></a> <a href="https://bne.social/tags/http" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>http</span></a> <a href="https://bne.social/tags/fullstack" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fullstack</span></a> <a href="https://bne.social/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a></p>