I am using reactjs.
When I run the code below the browser says:
Uncaught TypeError: Super expression must either be null or a function, not undefined
Any hints at all as to what is wrong would be appreciated.
First the line used to compile the code:
browserify -t reactify -t babelify examples/temp.jsx -o examples/public/app.js
And the code:
var React = require('react');
class HelloMessage extends React.Component {
render() {
return <div>Hello </div>;
}
}
UPDATE: After burning in hellfire for three days on this problem I found that I was not using the latest version of react.
Install globally:
sudo npm install -g [email protected]
install locally:
npm install [email protected]
make sure the browser is using the right version too:
<script type="text/javascript" src="react-0.13.2.js"></script>
Hope this saves someone else three days of precious life.
extends React.component
(lowercasec
). – Kevin SuttleComponents
instead ofComponent
:). Your comment helped BTW – P-RAD