iway1 / react-ts-form

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

fixed typescript props to name mapping #38

Closed W1ckh3ad closed 1 year ago

W1ckh3ad commented 1 year ago

Hello there,

while using two or more customSchemas, the type mapping was failing. It matched all ZodBranded results together.

I've fixed this issue and also build a test file.

I strongly think this could get dont more efficiently, but after 1.5 weeks of advanced typescript it works :D --> I appreciate every recommendation on improving the types :)

I will now start migration from formik and document it

EDIT:

Check out the error with my test repos here

iway1 commented 1 year ago

there ended up being more type issues to deal with and I ended up fixing some of the same stuff you fixed here.

I think I may have repeated the work you did, I shoulda checked your PR first (still figuring out this Open Source stuff lol)

I will say your types look cleaner than mine 😅 Gonna close just b/c this should be fixed in the current version