2016-03-24 2 views
1

http://plnkr.co/edit/f8Z4bucIq0WblkNSIMP5?p=previewPlunker

render: function() { 
     console.log('render', this.state) 

    return (
     <div> 
     <p>Click to get the full Modal experience!</p> 

     <ReactBootstrap.Button 
      bsStyle="primary" 
      bsSize="large" 
      onClick={this.open} 
     > 
      Launch demo modal 
     </ReactBootstrap.Button> 

     <ReactBootstrap.Modal show={this.state.showModal} onHide={this.close}> 
      <span>The Modal</span> 
     </ReactBootstrap.Modal> 
     </div> 
    ); 
    } 

上で反応し、ブートストラップモーダルをレンダリングしようとJSXをコンパイルしているようです。 Modalコンポーネントが利用可能です。ボタンをクリックするとshow propが設定されています。ブートストラップCSSはそこにあります。

しかし、show propがfalseの場合でも、Modalは常にページの読み込みに表示されます。

私は間違っていますか?

答えて

1

私はちょうどあなたのプランナーを見て、以前のバージョンの反応ブートストラップを使用しているのを見ました。私はこれがあなたの問題だと思って、私は新しいバージョンにバージョンを変更し、それは働いた。

https://cdnjs.com/libraries/react-bootstrap私はちょうどv0.28.3を使用しました。

関連する問題