Question: I would like to jump to the start of a Bash script. Is there an easy way to do this?

```
#start
echo "Start"

read -p "Input: " i

if [ i = j ]
then
z=1

elif [ i = n ]
then
#jump to start

elif [ i = x ]
then
exit
fi

```

Answer: 
You can set results as state and update it on `onClick` and use `else ... if` for check

```
const [results, setResult] = useState("");

const onClick = () => {
    // check users guess against randonNumber
    const userGuess = value;
    if (userGuess == randomNumber)
      setResult(<p className="alert alert-success">Correct!</p>);
    else if (userGuess > randomNumber)
      setResult(<p className="alert alert-warning">Too high, guess again</p>);
    else if (userGuess < randomNumber && userGuess !== "")
      setResult(<p className="alert alert-warning">Too low, guess again</p>);
    else setResult("");
  };

  return (
    <>
      <h2>Guess The Number game</h2>
      <p className="lead">Guess a number between 1 and 10.</p>
      <input value={value} type="number" onChange={onChange} />
      <button type="submit" onClick={onClick}>
        GUESS
      </button>
      <br />
      <br />
      {results}
    </>
  );

```

check here [CodeSandBox](https://codesandbox.io/s/guess-the-number-game-1pqmq)
Your results are always updating, because you are updating your state as soon as your input changes. This is still a good thing (as far as I know), but every time you update the state your whole component gets re-rendered, also the `results` object gets re-rendered and it gets recalculated because of this line:

```
results = onClick(value);

```

Therefore I'd suggest to also store the result in your state and only calculate it when the user clicks 'GUESS'.

NOTE: Please avoid comparisons with `==` in Javascript and always prefer `===` because its also checking type. Now it fails because you are comparing a number with a string -> check your datatypes and try to change it to `===`

NOTE 2: I'mm still a beginner with React too, so please excuse me if I didn't use good wording etc - thanks ;)