Wire up auto-binding
I keep getting this error using react edge. Uncaught TypeError: Cannot read property '__reactAutoBindMap' of undefined
If you believe this error is due to a bug in react, please post a simple example (fragment of code) that demonstrates the issue so we can reproduce/verify.
@jsfb found out it was because of API changes. was still calling renderComponent and not using createElement.
React.renderComponent(
div(null), document.getElementById( 'component' )
);
instead of
React.render(
React.createElement(div,null), document.getElementById( 'component' )
);
That still shouldn't happen. @jsfb Do you have a repro case now? It might be worth fixing and doing a point release sometime.
This was apparently with edge (presumably not 0.12). I also can't reproduce so I don't think there's anything to do here. Let us know if you see it again @dotfelixb!
http://jsfiddle.net/tiagorg/5L9qxnsq/ any suggestions how fix it
@coyotte
As of React's edge version (that's what you're using in the fiddle) you can no longer use component constructors directly when building virtual DOM tree. Use React.createElement instead.
Before:
React.renderComponent(
BoxesView({count: counter++}),
document.getElementById('grid')
);
After:
React.render(
React.createElement(BoxesView, {count: counter++}),
document.getElementById('grid')
);
(or you can use JSX transform which does this for you.)
See updated fiddle.
You can also change React's version to 0.12 where previous API is deprecated but is still working.
Same error occurs with stateless component defining. like this:
let StateLessView = (props)=> <div>{props.content}</div>;
And seems only with some environments: mine is windows 7, node 4.2.2; and node 5.x is fine.