import styles from './CloseAboutButton.css';

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

export default class CloseAboutButton extends Component {
    componentDidMount() {
        const { store } = this.context;
        this.unsubscribe = store.subscribe(() => {
            this.forceUpdate();
        })
    }
    componentWillUnmount() {
        this.unsubscribe();
    }
    render() {
        const { store } = this.context;
        return (
            <div
                className={
                    styles.root
                }
                onClick={
                    (e) => {
                        e.stopPropagation();
                        store.dispatch(setAboutVisibilityOption('CLOSE_ABOUT'));
                    }
                }
            >Return
            </div>
        )
    }
}

CloseAboutButton.contextTypes = {
    store: React.PropTypes.object
}
import styles from './CloseAboutButton.css';

import React, { Component } from 'react';
import { setAboutVisibilityOption } from '../../actions';
import { connect } from 'react-redux';

export let CloseAboutButton = ({dispatch}) => {
    return (
        <div
            className={
                styles.root
            }
            onClick={
                (e) => {
                    e.stopPropagation();
                    dispatch(setAboutVisibilityOption('CLOSE_ABOUT'));
                }
            }
        >Return
        </div>
    )
}

CloseAboutButton = connect()(CloseAboutButton);

Refactor CloseAboutButton to use 'connect' to receive dispatch