简体   繁体   English

找不到模块'react-i18next'

[英]Cannot find module 'react-i18next'

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'.我收到一个错误找不到模块“react-i18next”。 How to fix?怎么修?

type in your console npm install react-i18next在控制台中npm install react-i18next

you need to install the module你需要安装模块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM