TS2339: Property 'text' does not exist on type 'ITranslateResponse | ITranslateResponse[] | { [x: string]: ITranslateResponse; }'. Property 'text' does not exist on type 'ITranslateResponse[]'.
I use React and TypeScript.
const translator = new Translator({from: 'en', to: 'es', forceBatch: false, tld: 'es'}); const res = await translator.translate('Ik spreek Engels', {to: user_data!.lang}); console.log(res.text)
TS2339: Property 'text' does not exist on type 'ITranslateResponse | ITranslateResponse[] | { [x: string]: ITranslateResponse; }'. Property 'text' does not exist on type 'ITranslateResponse[]'.
I use React and TypeScript.
const translator = new Translator({from: 'en', to: 'es', forceBatch: false, tld: 'es'}); const res = await translator.translate('Ik spreek Engels', {to: user_data!.lang}); console.log(res.text)