• DessalinesA
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    2 years ago

    State (and rerenders based on changing state) as usual is the most difficult thing with front end, that react never fully got right.

    It wasn’t until I started doing android dev with compose, that I was able to step outside the react model, and think differently about the correct ways to handle it.

    I’ve been using inferno for many years(which is close to a drop in replacement for react, but more performant), but I’m finally going to rust, and sycamore / perseus for future projects, now that the performance has nearly caught up. I’m done with typescript and javascript 👏

    • ☆ Yσɠƚԋσʂ ☆OP
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      2 years ago

      I find nowadays, htmx is probably a good enough solution for most UIs. It just treats the UI as a dumb terminal that renders content and collects user input. Then all the actual logic moves to the backend.

      Personally, I’m a fan of a reactive model where the UI simply represents the state of the data. I think a lot of the complexity in React comes from the fact that it’s not opinionated regarding when a component should repaint. You have a lifecycle and it’s up to you to decide what to do within it and when.

      But you could just eliminate all but the render part of the lifecycle, and then just have reactive components observe the data and repaint when it changes. It’s a much simpler and more predictable model.