[–] [S] 0 points 4 months ago

Those are useful hooks for their own purpose. My approach might be more comparable to redux.

In contrast to redux, in this approach, we can update a state value and all other components listening will receive and update accordingly. Redux does this in a deterministic render and compares the vdom for what to update.

The origins on my approach is from trying to create it for webcomponents where components between different shadow-roots need to share an update.

  • source
  • parent
  • context
  • [–] 1 point 7 months ago (1 child)

    When used properly like the websocket example it's clear what it does. If you're using useEffect to sync props and state, then yes, you're going to have trouble reasoning through it. The solution is to not use useEffect because you're no longer writing React, you're writing Angular. No named function expression will fix that.

  • source
  • [–] [S] 1 point 9 months ago

    not in a database. The idea to normalize the state came from reading the React documentation, which mentions it as an alternative to deeply nested state. The next step is to print it as PDF. I've figured things out since posting this question, thanks so much for the help!

  • source
  • parent
  • context
  • [–] 2 points 9 months ago (1 child)

    Is this going in a database? I don’t know if I see the advantage of breaking apart company data into lots of little pieces. Why not just have a single object per company, and then have position, duration, and location be nullable/optional strings. And achievement can be an array of strings.

    Also, are you rending this to a webpage that you print, or did you wanna output directly to a PDF?

  • source
  • [–] 2 points 9 months ago

    It's what I keep complaining whenever there's talk about web systems, all these frameworks and libraries overcomplicate what should be simple. People have unlearned that the most important thing of any system is how the data is handled, the UI/UX comes second - it needs to actually work for the end user, but it should never be taken as more important than the actual data handling and the requirements.

  • source
  • [–] 1 point 10 months ago

    Few things disrupt developer flow more than waiting on a dev server.

    This feels incorrect

    How about:

    • Lack of documentation
    • Too much process
    • Jr devs
    • AWS us-east-1
    • Whatever Microsoft is doing currently
    • XCode
  • source
  • [–] 2 points 1 year ago

    I appreciated this insightful essay for explaining where each side is coming from, why being different is okay, and how this ties in to a bigger picture, rather than being a standard opinionated rant.

  • source
  • [–] 2 points 1 year ago

    React is very much the dominant framework,

    Unless you include libraries, in which case it's jQuery. There's still far, far more sites using jQuery compared to React. jQuery is trending down a bit, but the majority of the top million sites still use it.

    Not everything is a web app... A large number of sites are mostly static content with small amounts of interactivity. In those cases, React (or Preact or Vue or whatever) are generally overkill. Those types of sites are migrating away from jQuery, but they're migrating to either lightweight libraries like htmx, or just vanilla JS.

    I wonder if an AI coding tool would even suggest Preact as an alternative to React? 🤔

    I don't use any AI coding tools for personal projects, but at work we use custom tooling built on top of Claude. I'll have to check if it suggests Preact once I'm back at work.

  • source
  • parent
  • context
  • [–] 7 points 1 year ago (2 children)

    The article mentions a "React exodus", but that's not what I'm seeing at all. Some smaller use cases are migrating to Preact, sure, but there's also new developers starting to use React every day.

    Also jQuery is still the most popular JS library by far. It'll take a very long time for anything to overtake it.

  • source