Skip to content

Commit 1da7bdd

Browse files
committed
docs: tweak
1 parent 8261b4b commit 1da7bdd

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/plugin-rsc/README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ This is a wrapper of `react-server-dom` API and helper API to setup a minimal RS
441441

442442
## CSS Support
443443

444-
The plugin automatically handles CSS code-splitting and injection for React server components. This eliminates the need to manually call `import.meta.viteRsc.loadCss()` in most cases.
444+
The plugin automatically handles CSS code-splitting and injection for React server components. This eliminates the need to manually call [`import.meta.viteRsc.loadCss()`](#importmetaviterscloadcss) in most cases.
445445

446446
1. **Component Detection**: The plugin automatically detects React server components by looking for:
447447
- Function exports with capital letter names (e.g., `export function Page() {}`)
@@ -459,25 +459,18 @@ import './styles.css'
459459
export function Page() {
460460
return <div>Hello</div>
461461
}
462-
```
463462

464-
```tsx
465463
// After transformation
466464
import './styles.css'
467465

468-
function Page() {
469-
return <div>Hello</div>
470-
}
471-
472-
function __wrapper(props) {
466+
export function Page() {
473467
return (
474468
<>
475469
{import.meta.viteRsc.loadCss()}
476-
<Page {...props} />
470+
<div>Hello</div>
477471
</>
478472
)
479473
}
480-
export { __wrapper as Page }
481474
```
482475

483476
## Credits

0 commit comments

Comments
 (0)