首页 > 解决方案 > this.handleChange.bind(this) 和渲染使用

问题描述

我从 react bootstrap 网站 https://react-bootstrap.github.io/components/forms/得到了这段代码 我想知道代码中以下内容的使用

标签: javascriptreactjsecma

解决方案


  1. this.handleChange = this.handleChange.bind(this): 这是为了让你可以在 handlechange() 中使用变量“this”
  2. 通过设置一个空白值,如果您尝试在没有设置值的情况下引用它,该键将来不会为空
  3. validationState 作为属性传递给 FormGroup
  4. 渲染不在同一个类中,因此 FormExample 正在由它之外的其他东西渲染。

希望有帮助


推荐阅读