UNPKG

uniforms-react-semantic

Version:

Semantic React UI components for uniforms.

22 lines (16 loc) 785 B
/** * Created by cesar on 13/9/17. */ //import filterDOMProps from 'uniforms/filterDOMProps' const staticUnwantedProps = ['mapServerError', 'regEx', 'allowedValues', 'changed', 'label', 'changedMap', 'errorMessage', 'field', 'fieldType', 'fields', 'findError', 'findField', 'findValue', 'initialCount', 'parent', 'fieldType', 'showInlineError', 'component'] const filterSemanticProps = function (props = {}, unwantedProps = staticUnwantedProps) { const filteredProps = {}; for (const prop in props) { if (unwantedProps.indexOf(prop) === -1) { filteredProps[prop] = props[prop]; } } return filteredProps //filterDOMProps(filteredProps); } filterSemanticProps.unwantedProps = staticUnwantedProps export default filterSemanticProps