What does 'Only a ReactOwner can have refs.' mean?

前端 未结 12 2570
时光说笑
时光说笑 2020-11-27 15:50

I have a simple react component with a form in it:

var AddAppts = React.createClass({
    handleClick:          


        
12条回答
  •  孤独总比滥情好
    2020-11-27 16:11

    For me the reason for the same problem was that I've imported the ReactDom globally, as a property of the window object, like this:

    import ReactDOM from 'react-dom'
    window.ReactDOM = ReactDOM
    

    removing window.ReactDOM = ReactDOM fixed the problem.

提交回复
热议问题