Skip to content

Instantly share code, notes, and snippets.

@pastelsky
Last active January 13, 2019 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pastelsky/d0c391b9d31744e1d5a40deb2f1e538c to your computer and use it in GitHub Desktop.
Save pastelsky/d0c391b9d31744e1d5a40deb2f1e538c to your computer and use it in GitHub Desktop.
Class Properties
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 })
}
}
@rajatrao777
Copy link

rajatrao777 commented Jan 13, 2019

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 })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment