I need a modal to open with onClick, the variable calling the modal is nested between Translation keys. Here's some of the code. When clicking the link text, I currently have this error message: Cannot read property 'modaleNouvelleOeuvre' of undefined :-/
modaleNouvelleOeuvre(ouvert = true) { /*Ouvert means Open*/
this.setState({ modaleOeuvre: ouvert })
}
{t('flot.split.tableaudebord.vide.indication')}
<a href="#" onClick={(e) => { e.preventDefault(); this.modaleNouvelleOeuvre() }}>
{t('flot.split.tableaudebord.vide.indication-lien')}</a>
There's a button elsewhere on the page to open the same modal:
<Modal
open={this.state.modaleOeuvre}
onClose={() => { this.modaleNouvelleOeuvre(false); if (this.state.audio) this.state.audio.stop() }}
size="large"
closeIcon
closeOnDimmerClick={false}
>