Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

They just did a demo with a simple form and looking at it seemed so obvious.

There was no useState per form element, form data was trivially validated on the server, errors were trivially sent down to the server. If you look at this example[0] you'll see there's not a single useState, useEffect, etc.

Fundamentally, Remix is about using native browser behavior to build websites. The imported `Form` component is replaceable with the HTML `form` element and it all still works.

I think Remix is going to be even better than NextJS. This isn't a rivalry though, just an alternative solution. Clearly NextJS and React frameworks broadly are valuable, Remix is now another option.

I really like that Remix's architecture means you end up writing code that would execute on your server and not the client. It feels like a much nicer balance rather than doing everything on the client.

[0] https://github.com/remix-run/remix/blob/a56bdfd7f7e7fa9d8a3b...



> There was no useState per form element, form data was trivially validated on the server, errors were trivially sent down to the server

you can always do this, regardless of react or not, people did not do it because they want to do client side validation/feedback. Not to mention forms have nothing to do with endpoints. Mirroring your UI after some endpoints is a shitty way of making UI, or API. Sometimes you just have dialogs or wizards to build up the state of the payload and the submission happens much later.


> If you look at this example[0] you'll see there's not a single useState, useEffect, etc.

Sorry to point it out, but there is useRef, useEffect and a useUserData on lines 48, 53, and 47 respectively.


Ah i missed those cause this is different from the demo they showed. But the point still stands. There’s not a useDtate per form field which is how react normally handles forms


Hmm, you can easily use a normal form submit to pull field information from. We always want to do fancy things where we need the info while it is being changed though.


Forms are one of those things that are so much easier to manage in Vue (and no extra dependencies)

https://v3.vuejs.org/guide/forms.html


Two-way bindings could seem like a great idea at first, but then you start building on top of it.


let me clarify it with the specific complication I've always encountered. You always need a function to parse raw input, a dictionary of strings, to the typed model object, or fail, then there should be a function to serialize the model back to the input attributes. You owing these 2 functions make 2 ways binding useless.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: