React speech synthesis hook allows you Web Speech API.
npm install react-window-speech-synthesis
yarn add react-window-speech-synthesis
import useReactSpeechSynthesis from "react-window-speech-synthesis";
const [voices, speak, speechStatus] = useReactSpeechSynthesis();
useEffect(() => {
speak(text, currentVoice);
}, []);