reactbook icon indicating copy to clipboard operation
reactbook copied to clipboard

onClick(boolean) warning in rating.js

Open qwadzie opened this issue 8 years ago • 0 comments

warning in chrome: Warning: Expected onClick listener to be a function, instead got a value of boolean type. It still works though. for this code in render(): onClick={!this.props.readonly && this.setRating.bind(this, i)} onMouseOver={!this.props.readonly && this.setTemp.bind(this, i)} Instead, if you do this, no warning: onClick = { !this.props.readonly ? this.setRating.bind(this,i) : null} onMouseOver= { !this.props.readonly ? this.setTemp.bind(this,i) : null}

qwadzie avatar Nov 12 '17 19:11 qwadzie