Skip to content

Commit 8674961

Browse files
committed
Fix "Controlling stylesheet precedence" example
1 parent 2bfa7a6 commit 8674961

File tree

1 file changed

+6
-2
lines changed
  • src/content/reference/react-dom/components

1 file changed

+6
-2
lines changed

src/content/reference/react-dom/components/link.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,8 @@ export default function SiteMapPage() {
158158

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

161-
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 precedence goes later in the document even though the component that renders it comes earlier.
161+
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.
162162

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

165164
<SandpackWithHTMLOutput>
166165

@@ -172,6 +171,7 @@ export default function HomePage() {
172171
<ShowRenderedHTML>
173172
<FirstComponent />
174173
<SecondComponent />
174+
<ThirdComponent />
175175
...
176176
</ShowRenderedHTML>
177177
);
@@ -185,6 +185,10 @@ function SecondComponent() {
185185
return <link rel="stylesheet" href="second.css" precedence="low" />;
186186
}
187187

188+
function ThirdComponent() {
189+
return <link rel="stylesheet" href="second.css" precedence="high" />;
190+
}
191+
188192
```
189193

190194
</SandpackWithHTMLOutput>

0 commit comments

Comments
 (0)