Skip to content

Commit d3f8f88

Browse files
committed
Update README to include MarkdownTypewriterAsync component and bump version to 1.0.3
1 parent ea3b95a commit d3f8f88

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# React Markdown Typewriter
22

3-
This library provides a new component, `MarkdownTypewriter`, that combines the Markdown component of [react-markdown](https://www.npmjs.com/package/react-markdown) with the animation of typewriter. The animation was created entirely with [motion](https://www.npmjs.com/package/motion).
3+
This library provides 2 new component, `MarkdownTypewriter` and `MarkdownTypewriterAsync`, that combines the Markdown component of [react-markdown](https://www.npmjs.com/package/react-markdown) with the animation of typewriter. The animation was created entirely with [motion](https://www.npmjs.com/package/motion).
44

55
Live demo: <https://codesandbox.io/p/sandbox/react-markdown-typewriter-rgjf6t>
66

@@ -79,6 +79,22 @@ export default function NarrationScreen() {
7979
}
8080
```
8181

82+
## Async
83+
84+
The `MarkdownTypewriterAsync` component is variant of the `MarkdownTypewriter` component for use with `React.Suspense`. It allows you to load the content of the Markdown file asynchronously. This is useful if you want to load the content of the Markdown file from a server or from a local file.
85+
86+
```tsx
87+
import { MarkdownTypewriterAsync } from "react-markdown-typewriter";
88+
89+
export default function NarrationScreen() {
90+
return (
91+
<Suspense fallback={<div>...</div>}>
92+
<MarkdownTypewriterAsync>Hello World</MarkdownTypewriterAsync>
93+
</Suspense>
94+
);
95+
}
96+
```
97+
8298
## API
8399

84100
### props

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-markdown-typewriter",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "React Markdown component where Typewriter effect with motion has been added.",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.js",

0 commit comments

Comments
 (0)