Merge pull request #40 from le-mahf/patch-1

update button text to reflect state
This commit is contained in:
Angelos Chalaris
2019-02-02 10:40:37 +02:00
committed by GitHub

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' : 'Hide'} content
</button>
<div
style= {this.state.collapsed ? this.style.collapsed : this.style.expanded}