This is my code
import React from 'react';
import { useTranslation } from 'react-i18next';
function MyComponent() {
const { t, i18n } = useTranslation();
return <p>{t('my translated text')}</p>
}
export default MyComponent;
I get an error Cannot find module 'react-i18next'. How to fix?
type in your console npm install react-i18next
you need to install the module
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.