-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
less brittle element type checks #2971
Conversation
refactor Tabs to use type guard for childrenPreviews: documentation | landing | table |
TODO: |
fix Tabs type guardPreviews: documentation | landing | table |
add displayName fields to some Table componentsPreviews: documentation | landing | table |
oops lintPreviews: documentation | landing | table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find it a little odd that the Tab
element isn't responsible for its own rendering, but this would appear to fix the issue I was seeing.
Worth having a review from someone more expert.
element.type != null && | ||
element.type.displayName != null && | ||
element.type.displayName === ComponentType.displayName | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm looking forward to optional-chaining
Fixes #2958
Changes proposed in this pull request:
Utils.isElementOfType
now checksdisplayName
equality to support multiple minor versions.Tabs
andMultiSlider
a little bit to support this new usage.Reviewers should focus on: