react-markdown-typewriter 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -79,21 +79,23 @@ export default function NarrationScreen() {
79
79
  }
80
80
  ```
81
81
 
82
- ## Async
82
+ ## MarkdownTypewriterAsync
83
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.
84
+ Component to render markdown with support for async plugins
85
+ through async/await.
85
86
 
86
- ```tsx
87
- import { MarkdownTypewriterAsync } from "react-markdown-typewriter";
87
+ Components returning promises are supported on the server.
88
+ For async support on the client,
89
+ see [`MarkdownTypewriterHooks`](#markdowntypewriterhooks)
88
90
 
89
- export default function NarrationScreen() {
90
- return (
91
- <Suspense fallback={<div>...</div>}>
92
- <MarkdownTypewriterAsync>Hello World</MarkdownTypewriterAsync>
93
- </Suspense>
94
- );
95
- }
96
- ```
91
+ ## MarkdownTypewriterHooks
92
+
93
+ Component to render markdown with support for async plugins through hooks.
94
+
95
+ This uses `useEffect` and `useState` hooks.
96
+ Hooks run on the client and do not immediately render something.
97
+ For async support on the server,
98
+ see [`MarkdownTypewriterAsync`](#markdowntypewriterasync)
97
99
 
98
100
  ## API
99
101