DEV Community

Muhammad Talha Akbar
Muhammad Talha Akbar

Posted on

What would you do differently to build this simple form? Give your feedback!

Image description

It's been a while since I worked on a project from scratch. To check how things have since changed, I created a simple form project with React: https://main--vocal-moxie-c759df.netlify.app/

Check out the repo: https://github.com/dev-talha-akbar/react-recipe-form

What I have learned so far:

  1. Vite is fast and hassle-free. I have not had to change a single config.
  2. Bootstrap is still a great help. I could actually do way more with its well-documented and well-maintained components.
  3. It's hard to maintain state in React. It becomes frustrating to do simple operations especially on arrays.
  4. Since vanilla React easily becomes repetitive and frustrating, having React Query is a great addition to handle server logic.
  5. i18next is great but setting it up is a tricky endeavor with automatic file scans.

If you had the chance to look at the source code or the demo, what would you have done differently? What would you do next?

Top comments (3)

Collapse
 
webjose profile image
José Pablo Ramírez Vargas
  • React is a Mammoth. Switch to Svelte.
  • The demo shows up for me in German, which I cannot understand. I switched, yes, but it should detect language.
  • Having to search the ingredient, then edit to change the quantities is awkward.
Collapse
 
devtalhaakbar profile image
Muhammad Talha Akbar

Thanks @webjose for your great feedback. I have heard positive things about Svelte. I will definitely try it out. And yes, it does not detect the language currently. I will change that. But how would you suggest allowing to edit ingredients/quantities?

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

Hi. What about, after being selected from the auto-complete list, that the edit form automatically opens with the focus set on quantity? Furthermore: If there is no user input, a timeout of 5 seconds auto-commits the form. The form can also be committed by the ENTER key in the keyboard, regardless of the control that has the focus.

The timeout, if done, should cancel itself on any user keystroke, and maybe mouse move.