Skip to content

Fix version badges rendering unstyled in the docs#9450

Open
durvesh1992 wants to merge 1 commit into
facebook:mainfrom
durvesh1992:fix/versiontags-classname
Open

Fix version badges rendering unstyled in the docs#9450
durvesh1992 wants to merge 1 commit into
facebook:mainfrom
durvesh1992:fix/versiontags-classname

Conversation

@durvesh1992

Copy link
Copy Markdown

Summary

SinceVersion/UntilVersion in website/components/VersionTags.js rendered their <span> with the DOM attribute class instead of className. On React 18 (pinned by the website via react@^18.3.1) the unknown class prop is dropped, so the .version / .version.added / .version.removed styles (defined in website/src/css/custom.css) never applied — the version badges rendered completely unstyled.

These components are used in website/docs/types/utilities.md to show "≥0.317"-style version tags on the live docs site, so the issue is user-visible.

Changes

  • Switch classclassName on both spans so the existing CSS applies.
  • Remove the two $FlowFixMe[incompatible-type] class vs className suppressions — they only existed because Flow had correctly flagged the class usage, so they're now obsolete (and would otherwise become unused-suppression errors).

Verification

  • Confirmed .version, .version.added, .version.removed exist in website/src/css/custom.css.
  • Confirmed usage in website/docs/types/utilities.md.
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.
@meta-cla meta-cla Bot added the CLA Signed label Jun 29, 2026
@meta-codesync

meta-codesync Bot commented Jun 29, 2026

Copy link
Copy Markdown

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant