Open Tekbert opened 2 years ago
you should add the event listeners in componentDidMount
, then remove the listeners in componentWillUnmount
see https://github.com/ak1394/react-native-tts/pull/135
React.useEffect(() => {
const ttsStartEvent = Tts.addEventListener("tts-start", event => {
console.log("start", event);
});
return () => {
ttsStartEvent.remove();
};
}, []);
I made this component:
If i launch this as windows UWP, this causes the start/finish console logs to trigger multiple times after hitting the "Read text button". I assume it should only be called once? is there a way to fix this?