I'm using SkyLight react component to make modal dialog. The problem that I'm trying to solve is how to show different content in modal dialog using only one button.
<a className="btn btn-secondary" onClick={() => {
this.setState({
features: plan.features
})
this.dialog.show()
}}>Features</a>
The content that I want to show is Array
.
For example: features:["Feature 1", "Feature 2"]
I'm keeping that features in state
an show them on click using map looping.
<SkyLight hideOnOverlayClicked ref={ref => this.dialog = ref} title="Hi, I'm a simple modal">
{
this.state.features.map((feature)=>{
<h4>{feature}</h4>
})
}
</SkyLight>
When I click that button I have this error: Cannot read property 'show' of undefined
Any ideas how to solve this?\
Thanks