0
の「コンポーネント」私は私のDjangoアプリケーションのための反応、ブートストラップでモーダルウィンドウを作成しようとしている、私はこの反応し、ブートストラップをプロパティを読み取ることができません未定義
const WindowModal = React.createClass({
getInitialState(){
return {showModal: false};
},
close(){
this.setState({showModal: false});
},
open(){
this.setState({showModal: true});
},
render() {
return (
<div>
<p>Click!</p>
<Button bsStyle="primary" bsSize="large" onClick={this.open}>Launch</Button>
<Modal show={this.state.showModal} onHide={this.close}>
<Modal.Header closeButton>
<Modal.Title>Sign Up</Modal.Title>
</Modal.Header>
<Modal.Body>
<h1>Sign Up in Studio</h1>
</Modal.Body>
<Modal.Footer>
<Button onClick={this.close}>Close</Button>
</Modal.Footer>
</Modal>
</div>
);
}
});
ReactDOM.render(< WindowModal/>,
document.getElementById('contenu')
);
が、私は実行するようにJSXファイルを実装私のアプリでブラウザのコンソールでエラーが発生する
Uncaught TypeError: Cannot read property 'Component' of undefined
インポートする必要はありますか? – ChemseddineZ
importi el component sa7bi elbéhii –
「コンポーネント」というコンポーネントが見つからないというエラーが表示されます。また、childContextTypesまたはContextタイプを定義する必要があることを意味する可能性があります。私はこれらのコンポーネントがフラックスアーキテクチャを使用しているので、モーダルとボタンをインポートする必要があると仮定しています。 http://stackoverflow.com/questions/30717886/cannot-read-component-of-undefined-using-material-ui-with-browserify – Demon