Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/content/reference/react-dom/components/link.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,9 +158,8 @@ export default function SiteMapPage() {

### Controlling stylesheet precedence {/*controlling-stylesheet-precedence*/}

Stylesheets can conflict with each other, and when they do, the browser goes with the one that comes later in the document. React lets you control the order of stylesheets with the `precedence` prop. In this example, two components render stylesheets, and the one with the higher precedencegoes later in the document even though the component that renders it comes earlier.
Stylesheets can conflict with each other, and when they do, the browser goes with the one that comes later in the document. React lets you control the order of stylesheets with the `precedence` prop. In this example, three components render stylesheets, and the one with a `precedence` value that was discovered earlier goes earlier in the document even though a component that renders it comes later.

{/*FIXME: this doesn't appear to actually work -- I guess precedence isn't implemented yet?*/}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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


<SandpackWithHTMLOutput>

Expand All@@ -172,6 +171,7 @@ export default function HomePage() {
<ShowRenderedHTML>
<FirstComponent />
<SecondComponent />
<ThirdComponent />
...
</ShowRenderedHTML>
);
Expand All@@ -185,6 +185,10 @@ function SecondComponent() {
return <link rel="stylesheet" href="second.css" precedence="low" />;
}

function ThirdComponent() {
return <link rel="stylesheet" href="third.css" precedence="high" />;
}

```

</SandpackWithHTMLOutput>
Expand Down