Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot read property 'Header' of undefined when using react-bootstrap modal

I'm using react-bootstrap in my project. Getting an error like below while I am using Modal component.

enter image description here

modal component:

<Modal  show={this.state.modalshow} onHide={close}  container={this} aria-labelledby="contained-modal-title">
   <Modal.Header closeButton>
     <Modal.Title id="contained-modal-title">Add User</Modal.Title>
   </Modal.Header>
like image 470
Yasar Salim Avatar asked Oct 29 '22 21:10

Yasar Salim


1 Answers

Try Adding at Top

import Modal from 'react-bootstrap/lib/Modal';
// or
import { Modal } from 'react-bootstrap';
like image 193
Arshpreet Wadehra Avatar answered Nov 08 '22 05:11

Arshpreet Wadehra