react-native-stateless-form icon indicating copy to clipboard operation
react-native-stateless-form copied to clipboard

PropTypes check for children

Open kristian-puccio opened this issue 8 years ago • 0 comments

I guess we need to do this check so we don't try to focus a non-form element: if (child.type.propTypes && child.type.propTypes.value && child.type.propTypes.valid) {

Just I don't use propTypes as I'm using typescript. So I propose we do this another way: if (typeof child.props.value !== 'undefined') {

That way the presence of the value property (with value or not) is enough.

I guess another way of doing this is to have a 'isSelectable' prop.

Let me know what you think and I'll prepare a pull-request

kristian-puccio avatar May 13 '16 03:05 kristian-puccio