unclecheese / react-selectable

A component for react that allows mouse selection of child items
MIT License
142 stars 72 forks source link

Switch component prop blacklist to a whitelist #39

Closed tractorcow closed 7 years ago

tractorcow commented 7 years ago

At the moment we have:

const filteredProps = Object.assign({}, this.props);
        delete filteredProps.onSelection;
        delete filteredProps.fixedPosition;
        delete filteredProps.selectOnMouseMove;
        delete filteredProps.component;
        delete filteredProps.tolerance;
        delete filteredProps.preventDefault;

However we end up with errors still.

image

I suggest to change this to a filtered whitelist of properties that can be safely passed to any component.

tractorcow commented 7 years ago

Fixed with https://github.com/unclecheese/react-selectable/commit/0824bfa53dac614e79845c4cc6119b87aa1383a9