不断收到警告:无效的 DOM 属性“自动完成”。您指的是“自动完成”吗?

eli*_*kas 5 google-chrome reactjs

我不断收到此错误:“无效的 DOM 属性autocomplete。您是说吗autoComplete?” 当我在Google Chrome上编译我的 React 项目时。当我尝试在Firefox上编译代码时,一切正常。

我想问一个问题:如何修复 Google Chrome 上的此错误?为什么只在 Google Chrome 上显示此错误?

这是我的代码:

import React from "react";

import {
Container, Col, Form,
FormGroup, Label, Input,
Button,
} from 'reactstrap';

export default class Register extends React.Component{

render() {

    return (
        <div>

            <Container>
                <h2>Sign In</h2>
                <Form>
                    <Col>
                        <FormGroup>
                            <Label>Email</Label>
                            <Input
                                type="email"
                                name="email"
                                id="exampleEmail"
                                placeholder="myemail@email.com"

                              autocomplete = "email"
                            />
                        </FormGroup>
                    </Col>
                    <Col>
                        <FormGroup>
                            <Label for="PhoneNumber">Phone Number</Label>
                            <Input
                                type="Phone Number"
                                name="Phone Number"
                                id="exampleNumber"
                                placeholder="37060289225"
                            />
                        </FormGroup>
                    </Col>
                    <Col>
                        <FormGroup>
                            <Label for="RepeatPassword">Repeat Password</Label>
                            <Input
                                type="password"
                                name="Repeat Password"
                                id="RepeatPassword"
                                placeholder="********"

                               autocomplete="new-password"
                            />
                        </FormGroup>
                    </Col>
                    <Col>
                        <FormGroup>
                            <Label for="examplePassword">Password</Label>
                            <Input
                                type="password"
                                name="password"
                                id="examplePassword"
                                placeholder="********"

                               autocomplete = "new-password"
                            />
                        </FormGroup>
                    </Col>

                    <Button>Submit</Button>
                </Form>
            </Container>
        </div>
    );
}
}
Run Code Online (Sandbox Code Playgroud)

Nai*_*ith 5

当在输入中使用 prop autocomplete 时,它​​希望您将其替换为 autoComplete="new-password"