0
私はcreate-react-appを使ってサンプルアプリケーションを作成しましたが、npm start
を実行するとデフォルトのreact jsページが表示されました。私はその後、react-appのnpm startには何も表示されていません
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
);
にSRC内部app.jsを編集したが、これはnpm start
を行う上で空白のページが表示されます。私はチェックし、既にindex.htmlに<div id="root">
があった。だからこそ空白のページが表示されていますか?私はコンソールをチェックして、それが2つのエラーを示し
:
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in.
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in.