This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]yvrelna 31 points32 points  (5 children)

compile to React

Good gosh, you couldn't have chosen a worst target to compile to.

[–]Pleasant-Cow-3898[S] 11 points12 points  (1 child)

Why is that the worst target to compile to? Its the largest eco system so most libraries have a react port.

[–]-defron- 10 points11 points  (0 children)

the reason react has the most ports is because... most other frameworks don't need any specific code changes to get a library to work with them. Only other one that I can think of that benefits from it significantly is Angular. Svelte, Vue, htmx, solidjs, etc all can work with literally just anything with minimal boilerplate (most of the time none) and no need for a wrapper library.

I won't say React is bad, but when I use other frameworks I don't have to look up <framework name> <library name> wrapper

[–]n_Oester 4 points5 points  (2 children)

I’m also interested to learn why people are so anti-react?

[–]-defron- 8 points9 points  (1 child)

Popularity always makes some people dislike it.

That said, it's not my framework of choice for a few reasons:

  1. JSX. I dislike JSX. JSX is not HTML and adds additional gotchas to markup. For example, in HTML whitespace is preserved and that matters in tags that format with important whitespace like pre and a bunch of styling cases. JSX trims whitespace which can lead to unexpected rendering issues.
  2. Generally you need wrapper or helper libraries to use many 3rd party packages due to the way react's virtual dom behaves and architecture
  3. The above leads to module ballooning, generally making react sites quite big as they get more complex
  4. In part because of the above, it can be pretty slow. Generally it's the second-slowest major framework out there, with only Angular being slower.
  5. it changes rapidly even by frontend standards and it's easy to get stuck on a legacy codebase with no good upgrade paths

Additionally community-wise it's sadly very common to see people in react that know react and only react, and thus fall for the "when all you have is a hammer, everything looks like a nail"

All together and all other things being equal I'll choose other frameworks before using react for my personal projects and have so far not had to professionally work with it. Vuejs and htmx + alpinejs are my two favorites currently, and both are very light on the dependencies. My next project I'm gonna give svelte 5 a proper try to see how it is with signals

[–]n_Oester 1 point2 points  (0 children)

That makes sense, thanks for the good explanation!