iway1 / react-ts-form

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

make prop type ignore array cardinality #101

Closed scamden closed 1 year ago

scamden commented 1 year ago

@iway1 Our code finds a mapping based on array type ignoring cardinality but the prop types map only if the mapping includes the exact cardinality. This makes the Unwrap unwrap array cardinality as well so the types match the code behavior. I added a test that only compiles with this unwrap change and also tested to make sure the code actually renders this mapping regardless of cardinality as well.

Alternatively we could make the code match the types and render a different mapping for different cardinality arrays but i think this is likely preferred. Maybe a good follow on would be to expose minLength and maxLength in useArrayFieldInfo to use within the array component.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-ts-form ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2023 3:47pm