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 react@0.13.2
install locally:
npm install react@0.13.2
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.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…