Last active
January 13, 2019 06:11
-
-
Save pastelsky/d0c391b9d31744e1d5a40deb2f1e538c to your computer and use it in GitHub Desktop.
Class Properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Accordion extends Component { | |
/* | |
contructor() { | |
this.handleHeaderClick = this.handleHeaderClick.bind(this) | |
this.handleArrowClick = this.handleArrowClick.bind(this) | |
} | |
*/ | |
handleHeaderClick () => { | |
this.setState({ isOpen: !this.state.isOpen }) | |
} | |
handleArrowClick () => { | |
this.setState({ isOpen: !this.state.isOpen }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Shubham,
Came across your article in medium, Great post!!
i think slight changes in handle function.
missing = before ()
handleHeaderClick = () => {
this.setState({ isOpen: !this.state.isOpen })
}
handleArrowClick = () => {
this.setState({ isOpen: !this.state.isOpen })
}