Skip to content

Instantly share code, notes, and snippets.

@NikolayGalkin
Last active December 14, 2021 13:14
Show Gist options
  • Save NikolayGalkin/4bec00191f5f028c0c041746beb0e202 to your computer and use it in GitHub Desktop.
Save NikolayGalkin/4bec00191f5f028c0c041746beb0e202 to your computer and use it in GitHub Desktop.
import { DetailedHTMLProps, forwardRef, SelectHTMLAttributes } from 'react'
export const Select = forwardRef<
HTMLSelectElement,
DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>
>(({ children, ...rest }, ref) => {
return (
<select
ref={ref}
className="block w-full px-3 py-2 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-dodger-blue focus:border-dodger-blue sm:text-sm"
{...rest}
>
{children}
</select>
)
})
Select.displayName = 'Select'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment