In this post, we will see how to resolve Why is the renderValue function not being called? I want to give the Select dropdown a placeholder
Question:
The “renderValue” function is not working. I want to give the Select dropdown a custom placeholder but it doesn’t work.Here’s the Select component:
Best Answer:
I think that the issue is in therenderValue
function. As per your code, the render value would only return Placeholder
text when there is no selected option. But in the case when there is a selected option, it will return nothing. So what you want to do is update the renderValue function as below:If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com