jquense / uncontrollable

Wrap a controlled react component, to allow specific prop/handler pairs to be uncontrolled
MIT License
199 stars 33 forks source link

Ability to specify default props in `uncontrollable` function call #17

Closed nosovsh closed 8 years ago

nosovsh commented 8 years ago

It would be nice feature to be able to specify default props not only from parent component but also from uncontrollable function call. For example with a third argument:

var UncontrolledCombobox = uncontrollable(
        Combobox,
        {
          value: 'onChange',
          open: 'onToggle',
          searchTerm: 'onSearch' //the current typed value (maybe it filters the dropdown list)
        }, {
           open: true,
           searchTerm: '',
       }
)
nosovsh commented 8 years ago

Just realized it can be achieved using standard defaultProps, yes?

jquense commented 8 years ago

yup!

nosovsh commented 8 years ago

thanks :)