furqanZafar / react-selectize

http://furqanzafar.github.io/react-selectize/
Apache License 2.0
704 stars 138 forks source link

React uncontroller component being changed warning #155

Open jaischeema opened 7 years ago

jaischeema commented 7 years ago

Hi,

I am noticed that with the search and custom highlighting, we have been seeing this warning

Warning: ReactSelectize is changing an uncontrolled input of type hidden to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components

Is it a known thing or am I doing something wrong here?

joevo2 commented 7 years ago

Having this issue too...

yekaterinashenets commented 6 years ago

We should use serialize prop with empty string (not undefined as in docs)

serialize={(item) => !!item ? item.value : ''}