easy way to wrap Field component as a child component? #1103
Replies: 2 comments
-
I'm surprised this isn't talked about anywhere (here or in the docs). The "UI integration" example is nice and all, but how do we abstract this so we don't have to repeat all of the code everywhere? btw @heecheon92 nice job abstracting the Field component here |
Beta Was this translation helpful? Give feedback.
-
@heecheon92 @piotrpalek the short answer is because the functionality isn't finished yet. Theres an open PR #825 that will allow you to create re-usable components. But, it's not merged yet, theres a few internal types that need to be exposed, so unless you want to recreate them in your local code base you'll have to wait. The issue with abstracting the children like you have is the same issue I had here, you run into typing issues, and this only becomes more of an issue the more you have things like validators, listeners, and other functionality. But the maintainers are working on it, in-face it's the last checkmark on the v1.0 checklist. Hope this helps 🤟 |
Beta Was this translation helpful? Give feedback.
-
Sometimes, there are cases where I would like to wrap form.Field component inside of a wrapper / HOC.
but in order to split form.Field component, I have to go through something like this,
Is there a easier workaround to split Field component into a part of other wrapper component?
Beta Was this translation helpful? Give feedback.
All reactions