Skip to content

docs(core): document Link type="inherit" for inline links#3262

Merged
cixzhang merged 1 commit into
facebook:mainfrom
durvesh1992:fix/link-type-inherit
Jun 30, 2026
Merged

docs(core): document Link type="inherit" for inline links#3262
cixzhang merged 1 commit into
facebook:mainfrom
durvesh1992:fix/link-type-inherit

Conversation

@durvesh1992

Copy link
Copy Markdown
Contributor

Summary

Closes #2927, which asks for Link to support type="inherit" so inline links can adopt the surrounding text's styling.

On inspection, this already works: Link's type prop is typed TextType, which includes 'inherit', and Link forwards type straight to the inner <Text>. Text maps type="inherit" to font-size: inherit; line-height: inherit, and Link's base <a> already inherits font properties — so a link inside a Text block adopts that block's type through the normal inheritance chain.

What was missing was documentation and test coverage, so the capability wasn't discoverable. This PR:

  • Clarifies the type prop JSDoc to call out type="inherit" for inline links.
  • Adds an inline-link @example (<Text type="large">… <Link type="inherit">…</Link></Text>).
  • Adds regression tests: type="inherit" renders the inner Text with the inherit type (not body), and the default remains body.

No runtime/behavior change — docs + tests only.

Test plan

  • 28/28 Link tests pass, including the two new ones asserting the forwarded inherit class and the default body class.

Closes #2927

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 30, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice glad we can clarify this

@cixzhang cixzhang merged commit 47b8395 into facebook:main Jun 30, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

2 participants