Use a Ternary Expression for Conditional Rendering -- help

Tell us what’s happening:
Thank you if you are viewing this,
The problem I have is this: I wrote a fully working app but it is not passing the challenge, please help me figure out what is wrong

Your code so far

const inputStyle = {
  width: 235,
  margin: 5

class CheckUserAge extends React.Component {
  constructor(props) {
    // change code below this line
    this.state = {
      input: null,
      userAge: ''
    // change code above this line
    this.submit = this.submit.bind(this);
    this.handleChange = this.handleChange.bind(this);
  handleChange(e) {
      userAge: ''
  submit() {
      userAge: this.state.input
  render() {
    const buttonOne = <button onClick={this.submit}>Submit</button>;
    const buttonTwo = <button>You May Enter</button>;
    const buttonThree = <button>You Shall Not Pass</button>;
    return (
        <h3>Enter Your Age to Continue</h3>
          onChange={this.handleChange} /><br />
          /* change code here */
          // for the first time a page loads render buttonONe
          // if age < 18 return buttonThree else buttonTwo

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:

You have a flaw here. What’s this plus sign?

1 Like

The + turn a string to number type, thank you for replying I solve the challenge