"use strict";

import React from "react";
import store from "./redux/store";
import ContextMenuContainer from "./menu-container";

let { PropTypes } = React;

const ContextMenu = React.createClass({
    displayName: "ContextMenu",
    propTypes: {
        identifier: PropTypes.string.isRequired
    },
    childContextTypes: {
        store: PropTypes.object
    },
    getInitialState() {
        return store.getState();
    },
    getChildContext() {
        return {
            store
        };
    },
    componentDidMount() {
        this.unsubscribe = store.subscribe(this.handleUpdate);
    },
    componentWillUnmount() {
        if (this.unsubscribe) this.unsubscribe();
    },
    handleUpdate() {
        this.setState(this.getInitialState());
    },
    render() {
        return (
            <ContextMenuContainer {...this.props} {...this.state}/>
        );
    }
});

export default ContextMenu;

@@ -304,200 +304,59 @@
     
-childContextTypes: %7B%0A        store: PropTypes.object%0A    %7D,%0A    getInitialState() %7B%0A        return store.getState();%0A    %7D,%0A    getChildContext() %7B%0A        return %7B%0A            store%0A        %7D
+getInitialState() %7B%0A        return store.getState()
 ;%0A  

remove context usage