20
'da Geçersiz Bileşen Öğesi Basit bir Merhaba dünya örneği ile bir tepki.js öğreticisinden geçiyorum. Aşağıdakilerin işe yaramaması için bir neden bulamıyorum, ancak bu hatayı almaya devam ediyorum.React.JS
Uncaught Error: Invariant Violation: React.render(): Invalid component element.
Aşağıdaki kodum var. Ben React.createElement yaparsanız, ancak JSX öğeleri için çalışmıyor gibi görünüyor.
<!doctype html>
<html>
<head>
<script src="https://fb.me/react-0.13.3.js"></script>
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script>
<script type="text/jsx">
document.body.onload = function(){
console.log("shuff")
var HelloWorld = React.createClass({
render: function(){
return <div>Hello, Ian Shuff!</div>;
}
});
React.render(new HelloWorld(), document.getElementById("test"))
}
</script>
</head>
<body>
<div id="test"></div>
</body>
</html>