Skip to content

Commit ba247c7

Browse files
committed
Add docs about Stylesheet
1 parent e955d63 commit ba247c7

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ npm i react-async-elements
1717
- [`<Video>`](#video)
1818
- [`<Audio>`](#audio)
1919
- [`<Preload>`](#preload)
20+
- [`<Stylesheet>`](#stylesheet)
2021
- [`<IFrame>`](#todo)
2122
- [`<Embed>`](#todo)
22-
- [`<Stylesheet>`](#todo)
2323
- [Todo](#todo)
2424
- [Playing with Suspense](#playing-with-suspense)
2525
- [Authors](#authors)
@@ -172,6 +172,32 @@ function App() {
172172
export default App;
173173
```
174174

175+
### `<Stylesheet>`
176+
177+
Lazy load a stylesheet.
178+
179+
**props**
180+
181+
- `href: string`
182+
183+
```js
184+
import React from 'react';
185+
import { Stylesheet } from 'react-async-elements';
186+
187+
function App() {
188+
return (
189+
<div>
190+
<h1>Styles</h1>
191+
<React.Placeholder delayMs={300} fallback={'loading...'}>
192+
<Stylesheet href="style.css" />
193+
</React.Placeholder>
194+
</div>
195+
);
196+
}
197+
198+
export default App;
199+
```
200+
175201
## Todo
176202

177203
- [ ] `<IFrame>`

0 commit comments

Comments
 (0)