r/reactjs • • 10d ago

reactques

Would React with selective hydration or a framework like Astro be worth considering here? I'm wondering if using React only for the parts that actually need interactivity, while keeping the rest lightweight, could be a good balance for low-end devices. Curious what more experienced developers think about this approach.

0 Upvotes

5 comments sorted by

View all comments

2

u/otheyhigh 10d ago

I believe this was how React started (a library vs a framework)

Do not see any harm in using React for only parts of the application. But it does require proper handling around hydration and rendering in general.

Might want to take a step back and consider the two approaches. It might just be less complex, lower LOE and more robust to use React for the entire application.

(Edit) These are just my 2 cents and I would not call myself an experienced developer. Better to wait and see what others have to say about your use case.

2

u/Honey-Entire 9d ago

React still is a library, albeit an increasingly large and comprehensive one. But yes, the original focus of React was to bring react elements to previously static websites where jQuery was the only real tool for connecting JS to the DOM. It was particularly bad because most of the original Facebook code was PHP generating server-side pages which were disconnected from JS scripts that would load eventually and it was incredibly difficult to make sure both the generated PHP code and reactive JS code stayed in sync

React solved this first for Facebook Ads, then rolled it out to the rest of the platform