何らかの理由で、反応が私の単純なアプリで私のtxtプロパティをレンダリングしていません。 これはApp.jsファイル内の私のコードです:Reactはプロットをレンダリングしませんか?
import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {
render() {
return <h1> {this.props.txt}</h1>
}
}
ReactDOM.render(<App txt="Hello world"/>, document.getElementById('app'))
は、これは私がクロム開発ツールのコンソールで取得エラーです:
index.js:9576 Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).warning @ index.js:9576createElement @ index.js:26847(anonymous function) @ index.js:7558__webpack_require__ @ index.js:20(anonymous function) @ index.js:48__webpack_require__ @ index.js:20(anonymous function) @ index.js:40(anonymous function) @ index.js:43
index.js:8492 Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
どのバージョンのサンプルを以下のECMAで動作するようにいくつかのプリセットを追加する必要がありますか? –