No .bind() or Arrow Function in JSX Props
来源:互联网 发布:dmp数据 编辑:程序博客网 时间:2024/04/29 22:45
No .bind() or Arrow Function in JSX Props
issue from
https://github.com/MichaelCereda/react-native-form-generator/issues/45
warning code
export class InputField extends React.Component{ handleValidation(isValid, validationErrors){ this.valid = isValid; this.validationErrors = validationErrors; } setValue(value){ this.refs.fieldComponent.setValue(value) } focus(){ this.refs.fieldComponent.focus() } render(){ return(<InputComponent {...this.props} ref='fieldComponent' onValidation={this.handleValidation.bind(this)} //onChange={this.handleChange.bind(this)} //ref={this.props.fieldRef} /> ); }}
optimize code
export class InputField extends React.Component{ handleValidation(isValid, validationErrors){ this.valid = isValid; this.validationErrors = validationErrors; } setValue(value){ this.refs.fieldComponent.setValue(value) } focus(){ this.refs.fieldComponent.focus() } render(){ return(<InputComponent {...this.props} ref='fieldComponent' onValidation={this.handleValidation} /> ); }}
link read
- readOne
- readTwo
0 0
- No .bind() or Arrow Function in JSX Props
- Arrow Function in ES6:=>
- arrow function
- arrow function
- Debug: babel arrow function 'unexpected token' in React.Component
- 关于es6中的arrow function中的this以及bind(this)的比较
- es6之Arrow Function
- es6 的arrow function
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its
- arrow in svg
- es6新语法arrow function
- 错误码: 1418 This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its de 错误解决办法
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its de 错误解决办法
- 解决1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and b
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its de 错误解决办法
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary log
- 1418 - This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration a
- 标题:互联网轻松赚钱之道。。
- 游戏人生之 牵挂责任篇
- 2、互联网轻松赚大钱途径.txt
- 碧蓝天2013终身VIP课程《网络百万富翁修炼术》共9节(高清视频)
- 3、最没有风的互联网创业捷径.txt
- No .bind() or Arrow Function in JSX Props
- mysql数据库简单优化措施
- mongodb-study
- 从程序员角度分析2004年数学建模b题
- 用 python 操作 Excel 2007 表格 --- 准备篇
- 使用python的exec或eval语句。
- 4、网站源文件打包上传与在线解压.txt
- 如何通过网络卖信息产品快速赚钱3、如何通过网络在3天赚到100元.txt
- 8、做网络的捷径.txt