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 ( return (
<div> <div>
<button style={this.style.buttonStyle} onClick={this.toggleCollapse}> <button style={this.style.buttonStyle} onClick={this.toggleCollapse}>
Show/Hide Content {this.state.collapsed ? "Show Content" : "Hide Content" }
</button> </button>
<div <div
style= {this.state.collapsed ? this.style.collapsed : this.style.expanded} style= {this.state.collapsed ? this.style.collapsed : this.style.expanded}