update button text to reflect state

This commit is contained in:
le-mahf
2019-01-31 07:11:32 +00:00
committed by GitHub
parent b9382db30b
commit a2228b8189

View File

@ -40,7 +40,7 @@ class Collapse extends React.Component {
return (
<div>
<button style={this.style.buttonStyle} onClick={this.toggleCollapse}>
Show/Hide Content
{this.state.collapsed ? "Show Content" : "Hide Content" }
</button>
<div
style= {this.state.collapsed ? this.style.collapsed : this.style.expanded}