Closed rvignesh89 closed 6 years ago
Hi there and thanks for the kind words. Yes you need to handle the value possibly being null in your component. I don't think we'll change it since there are use cases where you might want to control how empty values are displayed but we should probably make a note about it n the docs
Alright. And yes, a mention of this in the docs would make it better. Thanks for the info!
I'm trying to create a DropdownList with a valueComponent without a defaultValue expecting to display an empty value. I'm doing it like this(using redux-form fields),
And the
LabelDropDownLisItem
looks like this,But rendering this causes an exception in my
LabelDropDownListItem
saying cannot access name of undefined. I thought this behaviour didn't match the documentation so just to see whats happening I went into the code and found this inDropdownListInput.js
If I'm correct, since I don't have a value or a placeholder and a
valueComponent
exists the code tries to render the component for the value which is undefined. I modified the code to the following which does work. Let me know if this makes sense.P.S: Found react-widgets to be really easy to use and highly customisable 👏