ErrorPro / react-google-autocomplete

React components for google places API.
MIT License
462 stars 114 forks source link

required attribute is not supported in Autocomplete component in TypeScript #210

Open jingcheng16 opened 1 year ago

jingcheng16 commented 1 year ago

Issue: TypeScript complains about passing required into Autocomplete

Description: The "required" attribute is not a standard HTML attribute that is supported by all input types, and therefore, it is not included in the React.HTMLAttributes interface. Would it be possible to update the ReactGoogleAutocompleteInputProps interface to include all HTML attributes that are supported by input types, regardless of whether they are considered standard or not? This would allow users to pass in any input attribute, including the "required" attribute, without encountering TypeScript errors.

My workaround: ts-ignore