こんにちは。
railsでtutorialを行っておりますが、エラーになってしまい、理由がわかりません。
エラーメッセージ
Uncaught Invariant Violation: ReactDOM.render(): Invalid component element. Instead of passing a string like 'div', pass React.createElement('div') or <div />.
ソースコード
app/asset/javascripts/components/comment_box.js.jsx.coffee
$ -> CommentBox = React.createClass render: -> `<div className="commentBox"> hello, world! i am a commentbox. </div>` ReactDOM.render '<CommentBox />', document.getElementById('content')
コンパイル後
$(function() { var CommentBox; CommentBox = React.createClass({ render: function() { return <div className="commentBox"> hello, world! i am a commentbox. </div>; } }); return ReactDOM.render('<CommentBox />', document.getElementById('content')); });
app/views/comments/index.html/slim
#content
呼び出すものはCommentBoxになっている気がするのですが・・・
よろしければご教授をお願いしますm(_ _)m
生のjsより、coffee scriptで書いていきたいので・・・
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/06/11 11:54
2016/06/12 07:36
2016/06/12 12:35