esbenp / react-native-clean-form

Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components
http://esbenp.github.io/2017/01/06/react-native-redux-form-immutable-styled-components/
MIT License
478 stars 76 forks source link

onValueChange is not a default prop #5

Closed BookSock closed 7 years ago

BookSock commented 7 years ago

throws error that function props.onValueChange does not exist. I changed to make it ignore the function call if it doesn't exists.

esbenp commented 7 years ago

Good catch! I think a better fix is to add a noop function to defaultProps

Select.defaultProps = {
  onValueChange: () => {},
  placeholder: '',
  labelKey: 'label',
  valueKey: 'value',
  value: ''
}
BookSock commented 7 years ago

Oh true. Yeah I agree.

esbenp commented 7 years ago

Are you going to update the PR or should I?

BookSock commented 7 years ago

Sorry, just updated it

esbenp commented 7 years ago

Thanks 👍 deployed in 0.1.1