When I'm trying to use the code listed below I'm getting error:
Uncaught TypeError: Cannot call a class as a function
import React, { PropTypes } from 'react';
import Confirm from 'react-bootstrap-confirm';
class myComponent extends React.Component {
componentDidMount() {
this.refs.confirm
.show('are you sure?')
.then(() => {
//after sure
})
.catch(() => {
//after cancel
})
}
render() {
return (
<div>
<Confirm.Component ref="confirm" title="Tips" sure="Sure" cancel="Cancel" />
</div>
);
}
}
export default myComponent;
When I'm trying to use the code listed below I'm getting error:
Uncaught TypeError: Cannot call a class as a function