Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

<Form ref="signUpForm" autocomplete="off">
    <FormInput type="text" placeholder="请输入手机号" />
</Form>

react处理自定义属性就直接过滤掉啦


react 把 autocomplete 当作 props 了 打印 props 可以看到


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
526 views
Welcome To Ask or Share your Answers For Others

1 Answer

Form是你自己定义的组件,它有ref属性,但没有autocomplete之类的真实DOM的属性。

你得这么用

render(){
    return <form autocomplete="off"></form>
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...