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

前端 未结 12 2573
时光说笑
时光说笑 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 15:59

    None of the given solutions worked for me, though they certainly helped show me where to look.

    For some reason my project has two node_modules folders - one in the root directory and one a level up. I'm new to React so I don't know if this is normal or what. I'm just going with what Visual Studio gave me when I started a new project.

    Anyway, I knew which module was causing the problem, and it happened to only exist in one of the node_modules folders.

    I moved the problem module over to the other node_modules folder. Problem solved.

提交回复
热议问题