3 Matching Annotations
  1. Last 7 days
    1. The summary is, we cant use the if statement in JSX because that if statement will be written as a function parameter of React.createElement, and we cant do that. This is the same reason why we can't use the switch case and for statement inside JSX. Hopefully, my explanation will help you to understand why we can't write if statement in JSX

      povzetek

    2. The only difference is it will use the ternary operator in the React.createElement last parameter. And, technically, we can use the ternary operator as a function parameter. So our code will work

      ternarni ozraz

    3. The problem is that the if statement will be written to the React.createElement last parameter. And technically, we can't write if statement as a function parameter. So it break our code

      if stavek jsx