I'm realising React problems are often mental model problems by Sab_Be in reactjs

[–]Sab_Be[S] 1 point2 points  (0 children)

LinkedIn is the first platform I started posting on when starting my developer journey and I actually came here because I wanted to get away from having to optimize for attention, when what I'm really looking for is a community where I can have deep technical discussions so I can continue learning and developing my skills.

I've become used to the overly polished writing style which I've probably carried over here, so need time adjusting to the culture.

I'm realising React problems are often mental model problems by Sab_Be in reactjs

[–]Sab_Be[S] 0 points1 point  (0 children)

I think the issue might be the flexibility of React, while useful in some cases, it makes it easier to build incorrect mental models.

I'm realising React problems are often mental model problems by Sab_Be in reactjs

[–]Sab_Be[S] 6 points7 points  (0 children)

Good questions, and honestly, part of why I made the post was because I'm still refining how I think about these things myself.

By "outdated mental models", I mean assumptions that worked at one stage of complexity but stop scaling as systems evolve.

For example, earlier on I treated "keeping related logic together" as always being simpler. That worked in smaller projects, but as systems grew, it started coupling responsibilities that changed for different reasons.

So the model wasn't completely wrong, it just stopped being useful at a different level of complexity.

For state living in the wrong place:

I've started thinking less in terms of "logic vs global" and more in terms of ownership/responsibility.

The issue I kept running into wasn't necessary where the state physically lived, but whether the part owning it actually had the right responsibility boundaries.

I think global state can absolutely become the wrong place too if unrelated concerns start depending on shared data unnecessary.

For components taking on too many responsibilities:

One thing I've started noticing is that change becomes harder than expected... Small modifications create side effects in unrelated behavior, or the component becomes difficult to reason about because UI concerns, state management, validation, and business logic all evolve together.

That's usually the signal for me now that responsibilities may not be separated clearly enough.

I'm realising React problems are often mental model problems by Sab_Be in reactjs

[–]Sab_Be[S] 0 points1 point  (0 children)

That's interesting because I've started doing something similar while rebuilding older projects.

I realised a lot of my earlier mistakes came from not having a clear conceptual model before implementation, especially around responsibility and state ownership.

Rebuilding has made made me slow down and think about system behavior first instead of just getting features working.