Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to incorporate @form-instant/react-input-mapping into this project, continuation of #107 #124

Open
leomerida15 opened this issue Oct 23, 2024 · 2 comments

Comments

@leomerida15
Copy link

This is a continuation of issues #107, I created this little thing that is already in npm and is adnostic to the UI library and allows custom props for each component.

  • (document)[https://leomerida15.github.io/form-instant-react-mapping]
  • (npm)[https://www.npmjs.com/package/@form-instant/react-input-mapping]
  • (github)[https://github.com/leomerida15/form-instant-react-mapping]
@vantezzen
Copy link
Owner

I think conceptually this is very similar to the new @autoform libraries, right? Both systems map the zod types to rendering specific form elements - just with a bit of a different syntax.

@leomerida15
Copy link
Author

leomerida15 commented Oct 24, 2024

Hi @vantezzen I think I know how to transform the schema into an interpretable object, but by completely separating mapping and component glossary from the component library, it allows you to do several things in a much simpler way,

  1. adding custom components is much simpler because you only have to add it to the mapping object and it is global to all the forms without having to add a prop to each form component.
  2. it is simpler to separate the form into multiple blocks.
  3. if someone wants to create an additional library that includes component glossaries, it is simpler since you can edit all the parameters that each input accepts.
  4. by separating the mapping from the UI you also separate it from the form hook, you can use react-hook-form, @mantine/form or tanstack/form.
  5. the layout is simpler since you can distribute your form in a simpler way.

If this package seems like it to you, I hope you take it into account because I feel that this repository is becoming more complicated than it needs to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants