出现错误:将元素引用指定为字符串(容器)但未设置所有者。我如何解决?

时间:2018-04-03 01:33:10

标签: reactjs project-structure

我正在尝试构建正确的反应项目结构,以用于构建温度转换器。

问题 - 每次尝试通过类组件呈现JSx时,我都会收到以下错误:

exc_class

如何更正此问题?

配置和源目录的树结构:

APIKeyError

我认为导致错误的代码集是:

CelsiusComponent.js

api

InteractiveModel.js

Error: Element ref was specified as a string (container) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a functional component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded

index.js

configuration
├── index.html
├── main.css
└── main.js
source
├── InteractiveModel.js
├── components
│   └── CelsiusComponent.js
├── css
│   └── main.css
├── index.html
└── index.js

0 个答案:

没有答案