Are lazy fieldComponents worth it? #2147
Unanswered
literalpie
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The composition docs recommend adding components using the fieldComponents value, and making the components lazy to mitigate bundle-size issues that would be caused by including all components in the form object.
I'm really questioning if this is worth the trouble. If you have lazy components conditionally shown in your form, this can cause your suspense boundary to trigger when they are first shown. This can be improved by adding "smaller" suspense boundaries, but that's extra work and it still seems to be non-ideal UX.
The lazy components also cause issues for us in unit tests.
It seems like the main benefit of the fieldComponents pattern is autocomplete and guaranteeing that the field context is available, but this doesn't seem like it's worth the trouble.
Have others run into problems with this pattern? Has anyone had success bypassing the pattern and importing field components normally?
Beta Was this translation helpful? Give feedback.
All reactions