ElemeFE / element-react

Element UI
https://elemefe.github.io/element-react/index
MIT License
2.83k stars 444 forks source link

String ref in Dropdown component #1043

Open eakarpov opened 4 years ago

eakarpov commented 4 years ago

Description

Using Dropdown component leads to error

Error Trace (if possible)

Uncaught Error: Element ref was specified as a string (default) but no owner was set. This could happen for one of the following reasons:

  1. You may be adding a ref to a function 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

Solution

Upgrade component to new React guide rules

eakarpov commented 4 years ago

https://reactjs.org/warnings/refs-must-have-owner.html

eakarpov commented 4 years ago

react@16.12.0 - this version of react is used in the project