-
-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoField.componentDetectorContext is bypassed if schema specify a component #1114
Comments
changing that is probably a breaking change, maybe there is a way to opt-in that the componentDetector is always called? Some flag? |
maybe that could be a property of the bridge?
ifNotSet: calls the dector only if field does not specify |
Hey @macrozone. Indeed, making |
A summary from the v4 planning session for this ticket is we will move the |
in ReactPage a lot of users asked for having conditional fields in the schema, so by default we support an additional prop
showIf
that can be used in the schema to control whether a field should be shown based on other props. The implementation was fairly easy:unfortunalty a user noticed that this does not work when you specify a custom component in the schema using uniforms.component prop.
the provider above is never called for these fields.
I think it makes sense at first glance that any custom detector is bypassed when a component is specified, but still, it removes a lot of flexibility like the case above. Since
autoField
gets removed (#980), I actually ran out of ideas how to implement the showIf usecase properly.the problematic code line is this: https://github.com/vazco/uniforms/blob/master/packages/uniforms/src/createAutoField.tsx#L35
it would probably better if the
componentDetector
is responsible of handling the case wherecomponent
is defined on the fieldThe text was updated successfully, but these errors were encountered: