I am using antd design in my React app.
Here's a code snippet where I am facing the issues :
<Select showSearch optionFilterProp = "children" placeholder = "Select Company" value = "{this.state.company}" name = "company" onSelect = "{this.handleCompanyChange}" >
Now it shows the correct value selected if this.state.company
is not null
. But if this.state.company
is empty
or null
, placeholder doesn't shows up.
How can I solve this issue so that the placeholder appears if value
is null?
set this.state.company to be undefined instead of null.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With