【发布时间】:2018-09-09 16:29:36
【问题描述】:
我正在尝试在代码沙箱中运行 this React Context example,但收到此错误:
Invariant Violation
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Check the render method of `MyProvider`.
我将 React 设置为 16.3,并且代码本身是直接从 this Wes Bos example. 提取的。我已经查看了几次代码,但没有发现任何问题。这可能是我不理解的带有代码框的上下文设置吗?
【问题讨论】:
标签: reactjs codesandbox