-
Notifications
You must be signed in to change notification settings - Fork 45.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when using react/addons, related to error reported by many others: Uncaught TypeError: Cannot read property '__reactAutoBindMap' of null #3593
Comments
I don't know why this would be related to addons, but it sounds like you're using an old JSX transformer. Can you check if that's the case? |
Thanks for the reply. I'm using reactify 1.1 which seems to be the most recent one. What else should I check? |
Can you look at the built file? Does it have |
Sorry for the newbie question, but I'm not sure where to find the processed file. I'm using rails with browserify and reactify and I have no idea where it puts the result js files. Can you point me to the right place? Thanks |
You can look at the script tag in the generated HTML to see what's loaded. |
I have the same problem with react-0.13.2: index.html <!doctype html>
<html lang="en">
<head>
<script src="external/react.js"></script>
<script src="external/JSXTransformer.js"></script>
<meta charset="utf-8">
<title>React Test</title>
</head>
<body>
<div id="app">Here goes the app</div>
<script type="text/jsx" src="test.js"></script>
</body>
</html> test.js: /*
var CommentBox = React.createClass({
render: function() {
return (
<div className="commentBox">
Hello, world! I am a CommentBox.
</div>);
}
});
React.render(<CommentBox/>, document.getElementById('app'));
*/
var CommentBox = React.createClass({
render: function() {
return (React.createElement('div', null, 'Hello, world! I am a CommentBox.'));
}
});
React.render(CommentBox(), document.getElementById('app')); this gives me
if I uncomment the upper part of the js and comment out the lower part it works. I tried taking out JSXTransformer.js, with and without add-ons, and many other configurations without luck. |
Make sure you are indeed using the correct version of react. In my case I had 2-3 different strange issues before I found out I was using the wrong version of React because of some dependency I was not aware of. Try "npm list react" to make sure you have only one react there... |
I'm using only this version for the test: |
Yes, I also was sure I was only using this version, but eventually found out that was not the case because of that dependency in one of the modules I was using... |
I'm not using npm, just plain HTML, a javascript file and the unpacked files from react. It works with react 0.12.2 |
@ivanflorentin Your @shaimo Closing because it sounds like you found your issue. |
@ivanflorentin You should have seen a warning in the console too pointing this out. |
thanks @spicyj,
|
@ivanflorentin Your code works fine for me here: http://jsbin.com/venaqozebi/1/edit If you can make a repro case in jsbin for me to look at, I'm happy to investigate. |
@spicyj |
Yes, you need to pass an element (either |
@spicyj Thank you very much, it works now. guess I just have to adjust the code. |
Yes, this was a deprecation introduced in 0.12 and completely removed in 0.13. See http://facebook.github.io/react/blog/2014/10/14/introducing-react-elements.html for more details. You should have received console warnings for these when running under 0.12. |
I managed to isolate the issue. I have the simplest component:
And then using it:
This gives the infamous:
But - if you replace
with
everything works fine with no errors or warnings. Is this some incompatibility with 0.13.2 and its addons part? Am I missing anything?
The text was updated successfully, but these errors were encountered: