import React, {PropTypes} from 'react';

export const TreeView = React.createClass({
    propTypes: {
        collapsed: PropTypes.bool,
        defaultCollapsed: PropTypes.bool,
        nodeLabel: PropTypes.node.isRequired,
        className: PropTypes.string,
        itemClassName: PropTypes.string,
    },

    getInitialState() {
        return {collapsed: this.props.defaultCollapsed};
    },

    handleClick(...args) {
        this.setState({collapsed: !this.state.collapsed});
        if (this.props.onClick) {
            this.props.onClick(...args);
        }
    },

    render() {
        const {
            collapsed = this.state.collapsed,
            className = '',
            itemClassName = '',
            nodeLabel,
            children,
            defaultCollapsed,
            ...rest,
        } = this.props;

        let arrowClassName = 'tree-view_arrow';
        let containerClassName = 'tree-view_children';
        if (collapsed) {
            arrowClassName += ' tree-view_arrow-collapsed';
            containerClassName += ' tree-view_children-collapsed';
        }

        const arrow =
            <div
                {...rest}
                className={className + ' ' + arrowClassName}
                onClick={this.handleClick}/>;

        return (
            <div className="tree-view">
                <div className={'tree-view_item ' + itemClassName}>
                    {children ? arrow : <span>&nbsp;&nbsp;</span>}
                    {nodeLabel}
                </div>
                <div className={containerClassName}>
                    {children}
                </div>
            </div>
        );
    },
});

export default TreeView;
import React, {PropTypes} from 'react';

export const TreeView = React.createClass({
    propTypes: {
        collapsed: PropTypes.bool,
        defaultCollapsed: PropTypes.bool,
        nodeLabel: PropTypes.node.isRequired,
        className: PropTypes.string,
        itemClassName: PropTypes.string,
    },

    getInitialState() {
        return {collapsed: this.props.defaultCollapsed};
    },

    handleClick(...args) {
        this.setState({collapsed: !this.state.collapsed});
        if (this.props.onClick) {
            this.props.onClick(...args);
        }
    },

    render() {
        const {
            collapsed = this.state.collapsed,
            className = '',
            itemClassName = '',
            nodeLabel,
            children,
            defaultCollapsed,
            ...rest
        } = this.props;

        let arrowClassName = 'tree-view_arrow';
        let containerClassName = 'tree-view_children';
        if (collapsed) {
            arrowClassName += ' tree-view_arrow-collapsed';
            containerClassName += ' tree-view_children-collapsed';
        }

        const arrow =
            <div
                {...rest}
                className={className + ' ' + arrowClassName}
                onClick={this.handleClick}/>;

        return (
            <div className="tree-view">
                <div className={'tree-view_item ' + itemClassName}>
                    {children ? arrow : <span>&nbsp;&nbsp;</span>}
                    {nodeLabel}
                </div>
                <div className={containerClassName}>
                    {children}
                </div>
            </div>
        );
    },
});

export default TreeView;
Make all working again. Meteor version updated
Make all working again.
Meteor version updated
