Fix version badges rendering unstyled in the docs#9450
Open
durvesh1992 wants to merge 1 commit into
Open
Conversation
SinceVersion/UntilVersion rendered their span with the DOM attribute "class" instead of "className". On React 18 (pinned by the website) the unknown "class" prop is dropped, so the .version/.added/.removed styles never applied and the version tags in the type-utilities docs showed up unstyled. Switch to "className" so the existing CSS applies, and remove the two $FlowFixMe[incompatible-type] suppressions that only existed because Flow had correctly flagged the "class" usage.
|
This pull request has been imported. If you are a Meta employee, you can view this in D110080287. (Because this pull request was imported automatically, there will not be any future comments.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SinceVersion/UntilVersioninwebsite/components/VersionTags.jsrendered their<span>with the DOM attributeclassinstead ofclassName. On React 18 (pinned by the website viareact@^18.3.1) the unknownclassprop is dropped, so the.version/.version.added/.version.removedstyles (defined inwebsite/src/css/custom.css) never applied — the version badges rendered completely unstyled.These components are used in
website/docs/types/utilities.mdto show "≥0.317"-style version tags on the live docs site, so the issue is user-visible.Changes
class→classNameon both spans so the existing CSS applies.$FlowFixMe[incompatible-type] class vs classNamesuppressions — they only existed because Flow had correctly flagged theclassusage, so they're now obsolete (and would otherwise become unused-suppression errors).Verification
.version,.version.added,.version.removedexist inwebsite/src/css/custom.css.website/docs/types/utilities.md.