UNPKG

react-element-to-jsx-string

Version:

Turn a ReactElement into the corresponding JSX string.

13 lines (11 loc) 277 B
/* @flow */ export default function createPropFilter( props: {}, filter: string[] | ((any, string) => boolean) ) { if (Array.isArray(filter)) { return (key: string) => filter.indexOf(key) === -1; } else { return (key: string) => filter(props[key], key); } }