Hacker News new | ask | show | jobs
by simonw 1798 days ago
Then you can switch to something like React. But most projects won't ever get close to the level of complexity you are describing.

Meanwhile I have seen SO MANY sites that use full React for a contact form with two fields on it.

3 comments

You don't need to get close to that level of complexity for React to become useful.

> Meanwhile I have seen SO MANY sites that use full React for a contact form with two fields on it.

I agree that the contact form you describe would be dead-easy to do vanilla. Maybe throw in Parcel if you want to write ES6.

However, while I suspect some people may use React in this case because it's all they know, others may do it because they are literally faster in React - they have a workflow that can see them code and deploy such a website to Netlify or Heroku or whatever in 10 minutes.

Preact to render the view and a dozen lines to handle the submission and data in a closure are still likely an easier solution than vanilla JS.
Which is fine if your company and teams use React a lot.

Why introduce inconsistency in everyone's workflow just because this specific page is a simple contact form?

The fact that it is just a simple contact form is exactly why you should use the same tools and workflow that everyone in your team has already been using.

Write what other people knows so you don't have to be the one maintaining it.