-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
BooleanField no longer displays label by default #6549
Comments
@WiXSL what's the motivation to moving away from FC typing? I'm guessing you moved the memo because Typescript was throwing an error. |
Here: #6515 (comment) One solution could be to use default values for props inside the component instead of |
@WiXSL thank you for the response - the motivation makes sense! I raised a PR with an idea for maybe moving the responsibility to the displaying components. Let me know what you think, just throwing some ideas out there. |
We have to ping @fzaninotto and @djhi on how to solve this, but if this is a problem for |
Agreed, that's why I was thinking of moving the logic to the component with the responsibility of displaying the component. That way it fixes all of the fields that may encounter this issue rather than just |
I also encountered this issue with the |
What you were expecting:
When using the
BooleanField
the label should be displayed by default due to thedefaultProps
settingaddLabel
totrue
.What happened instead:
BooleanField
no longer displays the label without explicitly specifying theaddLabel
prop, this is breaking.Steps to reproduce:
BooleanField
component to a view with thelabel
prop set.addLabel
prop.Related code:
https://codesandbox.io/s/eloquent-silence-1te8b
Observe the tick with no label on this page: https://1te8b.sse.codesandbox.io/#/posts/13/show/2
Other information:
I think it's down to the memo being moved directly to the default export in this commit: b79787a#diff-d7c4dd12e78cb28e0370dc53068aa45ec475f6fe54b5b40db238547e6278f5aaR119
It's no longer respecting the
defaultProps
.Environment
The text was updated successfully, but these errors were encountered: