home.social

#reactrouter — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #reactrouter, aggregated by home.social.

  1. 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

    #reactrouter #conform #zod #http #fullstack #javascript

  2. Как сделать React Server Components в Electron с помощью Next.js и без открытых портов

    Статья про то как заставить работать React Server Components внутри Electron приложения с помощью Next.js при этом не запуская локальный сервер и не открывая порты. С возможностью публикации стандартными инструментами. А также исследование зачем все это надо.

    habr.com/ru/articles/852384/

    #react #react_server_components #electron #electronjs #nextjs #remix #reactrouter #rsc #tauri #уменякончиласьфантазия