Home

Awesome

npm travis coverage deps

Filter React props:

Install

npm i -S react-attrs-filter

Usage

import {
    getPropsFor,
    filterPropsFor,
    filterPropsExcept
} from 'react-attrs-filter';

console.log(
    getPropsFor('input')
);
// [ 'list', 'max', 'maxLength', 'min', 'multiple', … ]

console.log(
    filterPropsFor({ ololo: true, min: 0 }, 'input')
);
// { min: 0 }

console.log(
    filterPropsExcept({ ololo: true, min: 0 }, 'input')
);
// { ololo: true }

References