iway1 / react-ts-form

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

fix CustomChildComponent remount #131

Closed scamden closed 11 months ago

scamden commented 11 months ago

Noticed that having a function as child rendered as a component was causing the whole form to rerender on some kinds of changes. Call the function as a function instead to avoid this bug. Added a test to prove the issue and fixed.

Note: this does mean our custom child has all the limitations of a normal render prop, but I think that should have already been implied. If a true component is needed it can be rendered from within the function.

vercel[bot] commented 11 months 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 Jul 19, 2023 11:13pm
scamden commented 11 months ago

gonna go ahead and merge this since it's a bug fix