Solve React error "Property autocomplete does not exist on type"
Emmanuel Gautier / February 28, 2023
1 min read
Sometimes, it happens that an easy-to-solve issue takes you more time than it should because there are several solutions after making some search and you can not figure out what is the right one. The Typescript React error Property 'autocomplete' does not exist on type
is maybe one of them.
This error usually occurs when you try to use the autocomplete property on an HTML input element in a React component and TypeScript doesn't recognize it as a valid property.
This is just a matter of case-sensitive property! In order to solve this issue, you can change the autocomplete
property to the autoComplete
property. Here's an example:
function MyInput() {
return <input type="text" autoComplete="off" />;
}
Hope this post saved you some time.
Comments
Related Posts
How to use Chakra UI Button and Link components with NextJS Link
There is some glue to add to make Chakra UI and NextJS work together. The Chakra UI components do not generate the "a" tag by default for a link. Let's see how to use the Chakra button to generate links between pages.
Extends Express session SessionData type
Express Session allows to store a lot of different data. There is a Typescript type named `SessionData` which allow to know what contains a session but not the data you will defined after without defining them.
ESLint Global Variables
When we use some global variables defined elsewhere, eslint throws an error saying the variable is not defined. Here is how to configure eslint to ignore those.
Featured Posts
How to deal with Docker Hub rate limit on AWS
Since 2020, DockerHub has been limited to only 200 container image pull requests per six hours. This article will help you to deal with this limitation on AWS.
How to enable Python type checking in VSCode
Python now has support for type hints. In this article, we will see how to enable better IntelliSense and type checking analysis in VSCode.
How to manage Internationalization with NextJS SSG
Staticaly generating a website with the NextJS framework in different languages is not so obvious.