how to manage multi-panel state with fields validations in React

21 views Asked by At

I'm creating a landing page builder that you can drag/drop elements in the dropzone, when you click on any element a left panel appears with the settings for this element and so on (something like Figma's settings panel).

requirements:

  1. each field can have a validation required or not
  2. the entire app has a reset button
  3. best performance

What the best way to handle a state like that?

My thoughts:

  1. A single state across the entire app using Zustand, but Zustand doesn't provide form-like functionality (isDirty or reset or field validation)

  2. the entire app would be a single form using React-hook-form, but that would be terrible for performance

0

There are 0 answers