constructor(props) {
super(props);
this.state = {
active: false
}
}
toggle(){
this.setState({active: !this.state.active});
}
<Accordion.Toggle as={Card.Header} eventKey={index} className={(this.state.active ? "active" : "")} onClick={e =>this.toggle()}>{item.name}</Accordion.Toggle>