5

i fucking hate react and don't understand react

Is it cleaner to have useContext to pipe in override test data for storybook and write an outer context for that code only? Real production code can ignore and not set this.

Can child component onHover update parent's stateful variable to unpause the urql/graphql datafetch in parent data wrapper component. Parent pipes queried data to child component to properly display on hover that kicked process off.

Comments
  • 0
    I love react because it is simple. It can be tricky at time, but most of the time i get stuck I realize I tried to over-engineer things.

    Is your child component pure? It sounds like you just need to pass an onHover callback down
  • 1
    @retoor I know right. Most of these frontend frameworks are so insanely over engineered

    Like why is reddit so damn laggy? It's literally just a static page with an infinite scroll. That's like 200 lines of javascript in total. Instead they pull in megabytes of minified jabbascript
  • 0
    @12bitfloat I bet half of it is marketing related fingerprinting.

    Half of it is skill issues.
  • 0
    I know little of frontend and I don't really like any of the frameworks, but recently I was giving svelte 5 a try and it's kinda working for me. I like the "runes" they introduced and it's (for the most part) intuitive to work with... but I'm only using it for toy projects with a proper compiled backend so I can't say much more about it
  • 1
    Reddit just has awful engineers, it's possible to achieve good performance and little js with either vanilla or frameworks

    Remember the video quality picker downloads all of them at once and chooses it locally
    Or the year old bug where you send a post multiple times
  • 0
    @retoor Okay but still, that's like an additional 20 lines of javascript. I just don't see how most websites need these kitchen sink behemoth libraries when fetch() and appendChild() would have done the same thing in a fraction of the complexity and overhead
  • 0
  • 0
    @12bitfloat DOM calls number increase exponentially. React is not that big, it just keep tracks of state and check when to update what. The biggest part is JSX which is just syntaxic sugar.
  • 0
    @antigermgerm I don't think the child component is pure at the moment.

    It needs to change a parent component variable to unpause the urql query, which would be the data rendered by the child component.

    I have a working solution that has the lazy loaded query data which is kicked off by first hover, all together in the child component.

    Problem is the stubbing that out for storybook test data, which seems neatly solved with a react useContext, but I was asked if we can work around this. Leading me to my original post.
  • 0
    @sjwsjwsjw

    just pulling the eventHandler up to do the work against variables pulled up, then passed down to child worked

    i dont understand and still hate react
Add Comment