react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Uncaught TypeError: Cannot read property '_currentElement' of null

Open ziweizhou opened this issue 11 years ago • 8 comments

Hello

Not sure why I am getting this error message when I try to create a simple Select

var Select = require("react-select");
var TaskList = React.createClass({
  render: function() {
    return (
      <div>
            <Select multi={false} placeholder={'Select your favourite(s)'}
              value={'AL'}
              options={[{ value: 'AL', label: 'Alabama' }]}
          />
          </div>

    );
  }
});

error message Uncaught TypeError: Cannot read property '_currentElement' of null

Thanks

ziweizhou avatar Apr 16 '15 06:04 ziweizhou

I have the exact same issue. Did you resolve it?

vsobotka avatar Apr 28 '15 11:04 vsobotka

Hi, so I took a look at it a bit more and I found out, that the problem was (in my case) in gulpfile.js. To be specific, the debowerify transform for browserify. After deleting it, everything works fine. Hope this will help.

vsobotka avatar Apr 29 '15 06:04 vsobotka

@ZaphyrVonGenevese are you talking about your own gulpfile.js? In which case, should I close this issue?

dcousens avatar May 07 '15 02:05 dcousens

@dcousens Yes, I am talking about my own gulpfile.js. For me, feel free to close it.

vsobotka avatar May 08 '15 07:05 vsobotka

I'm assuming that it has something to do with somehow bringing in an older version of react.

I was having the same error message, in my case I was depending on browserify's reactify transform and letting that dependency bring in react as needed.

The fix was explicitly depending on react >= 0.12 in my dev-dependencies got rid of the error.

It might sense to add a note in the README for people that bump into this one. The fix is easy, but it's not clear what to do or why when you get this error.

JohnMorales avatar May 18 '15 16:05 JohnMorales

So what was the cause? I have the same issue and in searching for a solution other people were saying that it had to do with multiple different things. In my case I changed componentDidMount tocomponentWillMount

adampatterson avatar Dec 30 '15 17:12 adampatterson

@ any updates?

ongmin avatar Jan 14 '16 06:01 ongmin

what was the cause?has any one know?

Pines-Cheng avatar Mar 29 '16 08:03 Pines-Cheng