import React from 'react';
import PropTypes from 'prop-types';

import ExpandableListItem from './ListItem/ExpandableListItem';
import SimpleListItem from './ListItem/ListItem';

const ListItem = ({
    hideIndicator,
    children,
    ...props,
}) => {
    if (children) {
        return (
            <ExpandableListItem
                hideIndicator={hideIndicator}
                {...props}
            >
                {children}
            </ExpandableListItem>
        );
    }

    return (
        <SimpleListItem {...props} />
    );
};

ListItem.propTypes = {
    children: PropTypes.oneOfType([
        PropTypes.node,
        PropTypes.arrayOf(PropTypes.node)
    ]),
    notExpandable: PropTypes.bool,
};

ListItem.defaultProps = {
    children: null,
    notExpandable: false,
};

export default ListItem;

import React from 'react';
import PropTypes from 'prop-types';

import ExpandableListItem from './ListItem/ExpandableListItem';
import SimpleListItem from './ListItem/ListItem';

const ListItem = ({
    hideIndicator,
    children,
    ...props,
}) => {
    if (children) {
        return (
            <ExpandableListItem
                hideIndicator={hideIndicator}
                {...props}
            >
                {children}
            </ExpandableListItem>
        );
    }

    return (
        <SimpleListItem {...props} />
    );
};

ListItem.propTypes = {
    children: PropTypes.oneOfType([
        PropTypes.node,
        PropTypes.arrayOf(PropTypes.node)
    ]),
    hideIndicator: PropTypes.bool,
};

ListItem.defaultProps = {
    children: null,
    hideIndicator: false,
};

export default ListItem;

Fix propType for wrong prop
Fix propType for wrong prop
