JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.67k stars 4.13k forks source link

Uncaught TypeError: Cannot read property '_currentElement' of null #128

Closed ziweizhou closed 9 years ago

ziweizhou commented 9 years ago

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

vsobotka commented 9 years ago

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

vsobotka commented 9 years ago

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.

dcousens commented 9 years ago

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

vsobotka commented 9 years ago

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

JohnMorales commented 9 years ago

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.

adampatterson commented 8 years ago

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

ongmin commented 8 years ago

@ any updates?

Pines-Cheng commented 8 years ago

what was the cause?has any one know?