Topic: Modal doesn’t work after upgrading to pro
I recently upgraded to pro mdbreact version, but everything works fine except the Modal component. It was working fine in the Free version.
Following warnings are in the browser console.
index.js:2178 Warning: Unknown event handler property `onExited`. It will be ignored. in div (created by t) in t in div (created by t) in t __stack_frame_overlay_proxy_console__ @ index.js:2178 index.js:2178 Warning: Received `true` for a non-boolean attribute `in`. If you want to write it to the DOM, pass a string instead: in="true" or in={value.toString()}. in div (created by t) in t in div (created by t) in t
Here is my ModalPage,
import React from 'react'; import { Container, Button, Modal, ModalBody, ModalHeader, ModalFooter } from 'mdbreact'; class ModalPage extends React.Component { constructor(props) { super(props); this.state = { modal: false }; this.toggle = this.toggle.bind(this); } toggle() { this.setState({ modal: !this.state.modal }); } render() { return ( <Container> <Button color="danger" onClick={this.toggle}>Modal</Button> <Modal isOpen={this.state.modal} toggle={this.toggle}> <ModalHeader toggle={this.toggle}>Modal title</ModalHeader> <ModalBody> (...) </ModalBody> <ModalFooter> <Button color="secondary" onClick={this.toggle}>Close</Button>{' '} <Button color="primary">Save changes</Button> </ModalFooter> </Modal> </Container> ); } } export default ModalPage;
Here is App.js
import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; import ModalPage from './ModalPage' class App extends Component { render() { return ( <div className="App"> <ModalPage/> </div> ); } } export default App;
I can send source files for your reference.
Mikołaj Smoleński staff answered 6 years ago
michaelxin pro answered 6 years ago
roshanpr pro answered 6 years ago
Mikołaj Smoleński staff commented 6 years ago
Most probably You didn't reinstall package properly. You should delete mdbreact from dependencies, then type 'yarn', next add mdbreact with #dev and finally type yarn again to install it. Best RegardsFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: Yes
- Provided link: No