为了账号安全,请及时绑定邮箱和手机立即绑定

ThemeContext.Provider报错

ThemeContext.Provider一加,就报错

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of `App`.

Module../src/index.js

C:/Learning/react1010806/src/index.js:8

   5 | import * as serviceWorker from './serviceWorker';
  6 | import 'bootstrap/dist/css/bootstrap.min.css';
  7 |
>  8 | ReactDOM.render(
  9 |   <React.StrictMode>
 10 |     <App />
 11 |   </React.StrictMode>,

该怎么解决呢???

正在回答

1 回答

确认是否导入:import ThemeContext from './theme-context'


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
基于实例的 React16 傻瓜课程
  • 参与学习       22325    人
  • 解答问题       103    个

通过一系列简单有趣的例子,让你了解 React16 的基本概念和新特性

进入课程

ThemeContext.Provider报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信