前提・実現したいこと
以下の同じソースコードでindex.jsはHello, React!と表示されるますがApp.jsはエラーにはならないですが何も表示されません。その違いは何ですか?
また同じ.jsの拡張子なのにconsole.log('Hello!');もApp.jsでは表示されません。教えて下さい!
発生している問題・エラーメッセージ
index
1import React from 'react' 2import {render} from 'react-dom' 3 4render(<h2>Hello, React!</h2>, document.getElementById('root')) 5 6console.log('Hello!');
App
1import React from 'react' 2import {render} from 'react-dom' 3 4render(<h2>Hello, React!</h2>, document.getElementById('root')) 5 6console.log('Hello!');
試したこと
App.jsとindex.jsの違いを調べましたがよく分かりませんでした。
補足情報(FW/ツールのバージョンなど)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/09 09:02