import React, { Component } from 'react';
import CheckList from './CheckList';

class Card extends Component {
    constructor() {
        super(...arguments);
        this.state = {
            showDetails: false
        };
    }
    render() {
        let cardDetails;
        if (this.state.showDetails) {
            cardDetails = (
                <div className='card__details'>
                    {this.props.description}
                    <CheckList cardId={this.props.id} tasks={this.props.tasks} />
                </div>
                );
        }
        return (
            <div className='card'>
                <div className='card__title' onClick={
                    () => this.setState({showDetails: !this.state.showDetails})
                }>{this.props.title}</div>
                {cardDetails}
            </div>
                );
    }
}

export default Card;

@@ -220,24 +220,117 @@
    %7D;%0A    %7D%0A
+%0A    toggleDetails() %7B%0A        this.setState(%7BshowDetails: !this.state.showDetails%7D);%0A    %7D%0A%0A
     render()
@@ -760,105 +760,37 @@
 ck=%7B
-%0A                    () =%3E this.setState(%7BshowDetails: !this.state.showDetails%7D)%0A                
+this.toggleDetails.bind(this)
 %7D%3E%7Bt

Refactor onclick