Skip to content

Commit b9dfb77

Browse files
authored
docs: update. (#91)
1 parent 867ffc6 commit b9dfb77

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@
88

99
Repository for `tts-react`, a React component and hook that uses the [`SpeechSynthesis`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis) and [`SpeechSynthesisUtterance`](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance) API's to convert text to speech. You can fallback to the [`HTMLAudioElement`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio) API by providing a `fetchAudioData` prop to the hook or component.
1010

11+
> [!IMPORTANT]
12+
> Requires a peer dependency of React and ReactDOM >= 19.
13+
> Use `tts-react@3` if your project is on React 18.
14+
1115
## Install
1216

13-
`npm i react react-dom tts-react`
17+
```console
18+
npm i react react-dom tts-react
19+
```
20+
21+
For projects using React 18:
22+
23+
```console
24+
npm i react@18 react-dom@18 tts-react@3
25+
```
1426

1527
## Table of Contents
1628

packages/tts-react/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ By default `tts-react` uses the [`SpeechSynthesis`](https://developer.mozilla.or
1212

1313
## Install
1414

15-
`npm i react react-dom tts-react`
15+
```console
16+
npm i react react-dom tts-react
17+
```
18+
19+
For projects using React 18:
20+
21+
```console
22+
npm i react@18 react-dom@18 tts-react@3
23+
```
1624

1725
## Demo (Storybook)
1826

@@ -34,9 +42,9 @@ Get up and running quickly using `tts-react` with ESM from a CDN. This example u
3442
</head>
3543
<body>
3644
<script type="module">
37-
import { createElement } from 'https://esm.sh/react@rc/?dev'
38-
import { createRoot } from 'https://esm.sh/react-dom@rc/client?dev'
39-
import { TextToSpeech } from 'https://esm.sh/tts-react@next?deps=react@rc&dev'
45+
import { createElement } from 'https://esm.sh/react'
46+
import { createRoot } from 'https://esm.sh/react-dom/client'
47+
import { TextToSpeech } from 'https://esm.sh/tts-react'
4048
import htm from 'https://esm.sh/htm'
4149
4250
const html = htm.bind(createElement)

0 commit comments

Comments
 (0)