onesine / react-tailwindcss-select

Tailwind Select Component for React.js
https://demo-react-tailwindcss-select.vercel.app/
MIT License
183 stars 38 forks source link

Placeholder type too limited #32

Open timothyarmes opened 1 year ago

timothyarmes commented 1 year ago

From a Typescript standpoint, you currently you only accept a string as a placeholder (although in reality we can pass a component).

Passing a component allows us to style the placeholder in order to change its color. Could you please update the type to accept string | React.Node ?

onesine commented 1 year ago

Thank you for your feedback. This is indeed a string that we are currently using. There is no check to see if it is a string sent by the user. Typescript should indicate a typing problem. We did not plan to use a component instead of a string. This is a good idea and should work with the current code if we change the type of placeholder.

PRs are welcome