reactjs 删除拼写检查属性 [英] reactjs remove spellcheck attribute

查看:21
本文介绍了reactjs 删除拼写检查属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ReactJS 来呈现我的 DOM.

我想在文本输入上添加 spellcheck="false" 属性,所以我这样做:

render() {返回 (<div><input type="text" placeholder="Name" spellcheck="false"/>

)}

然后,当我使用 chrome 检查时,spellcheck 属性不存在.

解决方案

尝试改用 spellCheck.(注意大写 C)

文档 很好地解释了默认 HTML 属性应该如何在 React 中引用.

I'm using ReactJS to render my DOM.

I want to add the spellcheck="false" attribute on a text input, so I do this:

render() {
    return (
        <div>   
                <input type="text" placeholder="Name" spellcheck="false" />
        </div>
    )
}

Then, when I inspect with chrome, the spellcheck attribute is not present.

解决方案

Try using spellCheck instead. (Note the capital C)

The docs are good for explaining how default HTML attributes should be referenced in React.

这篇关于reactjs 删除拼写检查属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆