react-text-to-speech
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -20,3 +20,4 @@ import React, { cloneElement, isValidElement, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; | ||
}, [text]); | ||
const Text = useCallback(() => highlightedText(text), [speakingWord === null || speakingWord === void 0 ? void 0 : speakingWord.index, highlightText, stringifiedWords]); | ||
const reactContent = useMemo(() => highlightedText(text), [speakingWord === null || speakingWord === void 0 ? void 0 : speakingWord.index, highlightText, stringifiedWords]); | ||
const Text = useCallback(() => reactContent, [reactContent]); | ||
function start() { | ||
@@ -23,0 +24,0 @@ const synth = window.speechSynthesis; |
{ | ||
"name": "react-text-to-speech", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An easy-to-use React.js component that leverages the Web Speech API to convert text to speech.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -9,12 +9,12 @@ # react-text-to-speech | ||
- Highlights words as they are read aloud. See: | ||
- [Highlighting text with `useSpeech`](https://rtts.vercel.app/docs/usage/useSpeech#highlight-text). | ||
- [Highlighting text with `useSpeech` hook](https://rtts.vercel.app/docs/usage/useSpeech#highlight-text). | ||
- [Highlighting text with `Speech` component](https://rtts.vercel.app/docs/usage/speech#highlight-text). | ||
- Provides an API for handling errors and events: | ||
- [Error handling with `useSpeech`](https://rtts.vercel.app/docs/usage/useSpeech#handling-errors-and-events). | ||
- [Error handling with `useSpeech` hook](https://rtts.vercel.app/docs/usage/useSpeech#handling-errors-and-events). | ||
- [Error handling with `Speech` component](https://rtts.vercel.app/docs/usage/speech#handling-errors-and-events). | ||
- Manages multiple speech instances: | ||
- [Multiple instances with `useSpeech`](https://rtts.vercel.app/docs/usage/useSpeech#multiple-instance-usage). | ||
- [Multiple instances with `useSpeech` hook](https://rtts.vercel.app/docs/usage/useSpeech#multiple-instance-usage). | ||
- [Multiple instances with `Speech` component](https://rtts.vercel.app/docs/usage/speech#multiple-instance-usage). | ||
- Fully customizable for various use cases: | ||
- [Customizing `useSpeech`](https://rtts.vercel.app/docs/usage/useSpeech). | ||
- [Customizing `useSpeech` hook](https://rtts.vercel.app/docs/usage/useSpeech). | ||
- [Customizing `Speech` component](https://rtts.vercel.app/docs/usage/speech#full-customization). | ||
@@ -21,0 +21,0 @@ - Overcomes the [Web Speech API's text length limit](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisUtterance/text), enabling infinite text input. |
31835
537