Do you have any idea this error? I am getting ESlint error for the following line visible={this.state.visible}
It says: "Must use destructuring state assignment"
It uses: "eslint-config-airbnb"
Thank you in advance
import React from 'react'
import { Button, Modal } from 'antd'
class EditProfile extends React.Component {
state = { visible: false }
showModal = () => {
this.setState({
visible: true,
})
}
handleOk = e => {
console.log(e)
this.setState({
visible: false,
})
}
handleCancel = e => {
console.log(e)
this.setState({
visible: false,
})
}
render() {
return (
<div>
<Button type="primary" onClick={this.showModal}>
Modal Card
</Button>
<Modal
visible={this.state.visible}
onCancel={this.handleCancel}
footer={null}
className="custom-modal-v1"
centered
>
Text
</Modal>
</div>
)
}
}
export default EditProfile