You can't use if-else in React, and that bothers nobody — astounishing brainwashing
ArtyProg

ArtyProg @artyprog

About: AKA Artydev: Passionate about development. Inspired by digital art

Joined:
Sep 28, 2018

You can't use if-else in React, and that bothers nobody — astounishing brainwashing

Publish Date: Jul 6 '25
2 2

At what point have we arrived. A single imposed library succeeded at make us forgotten one of the most basic instruction of all programming languages.

And the vast majority of us have accepted quietly this fact, a veritable absurdity.

Whith that in mind we can conclude : JSX is not Javascript, JSX will not make you a better Javascript developper, it enjails you in its traps.

Look at this Juris code :

const view = {
  div: {
    children: () => {
      if (ctx.getState("error")) return { span: { text: "Error!" } };
      if (!ctx.getState("loaded")) return { span: { text: "Loading..." } };
      return { span: { text: "All good!" } };
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

No tricks. No ternaries. Just logic.

Rediscover the joy of developping with Javascript, don't let any frameworks wash, steal your skills

Here is a part of a discussion I have had wih Copilot :

Comments 2 total

  • Resti Guay
    Resti GuayJul 8, 2025

    The only reactive if/else. I love this article.

Add comment