I have made a component using react-speech-kit, it should speak the question whenever it comes on screen, but the speak function does not work fr the very first question and works fine after that
import { useSpeechSynthesis } from 'react-speech-kit';
import { useEffect } from 'react';
const TextToSpeech = ({question}) => {
const {speak} = useSpeechSynthesis();
useEffect(() => {
speak({text:question});
}, [question]);
}
export default TextToSpeech;