I'd like to call getStyles to see how the placeholder text is styled. How would I do this? https://react-select.com/props#select-props
You can create a pass through override to see dump the styles.
const placeholderStyles = (base, state) => {
console.log('placeholder styles', base);
return base;
};
<Select {...otherProps} styles={{placeholder: placeholderStyles}} />
Assuming you're inside a custom Placeholder component that you've created, you can use it like this:
const Placeholder = (props) => {
console.log(props.getStyles('placeholder', props));
return <YourPlaceHolderStuff />;
}
Hello -
In an effort to sustain the react-select project going forward, we're closing old issues.
We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our efforts towards the current major version.
If you aren't using the latest version of react-select please consider upgrading to see if it resolves any issues you're having.
However, if you feel this issue is still relevant and you'd like us to review it - please leave a comment and we'll do our best to get back to you!
Most helpful comment
Assuming you're inside a custom Placeholder component that you've created, you can use it like this: