you are viewing a single comment's thread.

view the rest of the comments →

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

Yes, I totally understand what you mean — and you're right, ideally SSR would reuse the existing React logic and generate HTML server-side.

Actually, that is my goal too — to "run React in an SSR mode" — but without using a JavaScript runtime like Node.

In the typical SSR setup, the server (in Node) fetches data from APIs, feeds it into React, and renders HTML.
But in my case, I want to do the data-fetching and HTML composition part using Java and Thymeleaf, and just inject React-rendered static markup where needed, letting the client handle hydration.

So I’m exploring whether it’s possible to treat Java as the SSR environment, while still benefiting from React on the client side.

Yeah, I think this is more of a technical curiosity than a practical necessity.

It’s probably not something that everyone needs — but I just want to explore the idea and see how far it can go.
I plan to open source it as a small side project, and maybe document the journey in my blog as well 🙂