this.state.input is a string, so this.state.input > char is not quite the comparison that you want to do
The input's style is being set with the inputStyle object defined inside the render method, so calling this.setState({inputStyle: '3px solid red' }) won’t do anything to the style of the input because input doesn’t get its styles from there
Following from the point above, the ternary expression is unnecessary (not least because it doesn’t actually make any sense as it is)
I hope that helps!
EDIT: corrected an incorrect assumption about coercion!
We are volunteers and we have own things to do, too.
Um, no.
Just giving you the solution is pointless and will only lead to more and bigger trouble for both you and everyone trying to help. Most people are interested in helping others to learn here, not helping others to copypasta.
As for the last code snippet you posted, you still haven’t fixed the points that I mentioned. Consider this:
console.log(this.state.input); // "nyanpasu"
const char = 15;
if (this.state.input > char) {
// Here you are saying if the string "nyanpasu" is greater than 15,
// then do something, does that make sense to you?
// ...
}
The additional set of curly braces is not wrong per se, but unnecessary here: {inputStyle = {border:'3px solid red'}}. What you are writing inside the render() method and **before the return keyword is just plain JavaScript, I think you are confusing those with the ones required to write JavaScript inside the JSX syntax (for example: <div>{42 > 4.2 ? '42' : '4.2'}</div>).