iway1 / react-ts-form

https://react-ts-form.com
MIT License
2.01k stars 35 forks source link

Dynamic lists #30

Closed afoures closed 1 year ago

afoures commented 1 year ago

Complex forms sometimes have some sort of dynamic lists, where the user can add/remove/swap fields to the form.

Is it a goal of react-ts-form to have something handling those?

Prior work

iway1 commented 1 year ago

It's not really a goal per-se. This library is moreso focused on quickly building out forms with explicitly defined fields.

Seems out of scope, but I'll leave this open in case others have any thoughts or desire for this library to allow dynamically rendering forms. Could be a cool separate library - some sort of typesafe dynamic form generator.

And just to be clear to anyone reading: This library does support array fields with z.string().array() for example, (just not dynamically adding / removing properties from the schema in a way that is typesafe).

iway1 commented 1 year ago

actually gonna close this and open a discussion