r/reactjs • • 4d 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

2

u/otheyhigh 4d 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 3d 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

1

u/Otherwise-Leather965 4d ago

Astro with React islands is a good fit if most of the page is content, since only the interactive bits ship any JS. If the app is mostly interactive, like a dashboard, you end up hydrating nearly everything anyway, so plain React with code splitting is simpler to maintain.

1

u/Sammytheherald 4d ago

Yeah, that's actually one of the best use cases for Astro. If most of your site is static content with a few interactive pockets like a filterable list, cart, or form, Astro's islands architecture lets you ship zero JavaScript for everything else and only hydrate those specific React components when they load or scroll into view. On low-end phones, skipping unnecessary JS parsing and hydration makes a huge difference in how snappy the page feels.

React's selective hydration with Suspense is still helpful if your whole page is genuinely an interactive app, since it prioritizes hydrating whatever the user is interacting with first. The catch is you're still shipping the React runtime and hydrating the rest of the tree in the background anyway.

The main trade-off comes down to how connected your interactive parts are. If you have a bunch of components sharing global state or you're building something that feels like a full dashboard with client-side navigation, sticking with React or Next.js is way less headache than trying to sync state across separate Astro islands. But for content-heavy sites targeting budget devices, Astro with React islands is hard to beat.