Is it valid to use Javascript codes within a ReactJs project? I have something like this,
JS
myFunc(e) {
let v = e.target.value
if(v.length > 0) {
e.target.parentNode.setAttribute('class', 'abc')
}
else {
e.target.parentNode.setAttribute('class', 'xyz')
}
}
HTML
<input ref="xxx" onBlur={this.myFunc.bind(this)} name="xxx" className="xxx" type="text">
This method works as I wanted but not sure weather it's safe to use such codes in ReactJs or not. Please advise me.