Quiero usar una biblioteca de texto a voz en React, la biblioteca está implementada con Javascript puro y quiero pasar un resultado de React que es un texto (cadena) a las funciones de esta biblioteca.
La función con JS: https://codesandbox.io/s/frosty-violet-t494o?file=/src/script.js
//inside script.js const TextToSpeech = (text) => { const textEl = document.getElementById("text"); ... }; export default TextToSpeech; //inside you react component import TextToSpeech from 'script.js'; //execute the function with your text const text="whatever text"; TextToSpeech(text)