Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Daan Schouten
Daan Schouten
14,454 Points

What is the simplest way of using React on the Server side, in an Express / Node setup?

Hi!

I've got a fairly simple MERN project setup. I use webpack to bundle my client-side js, jsx and css files, which works fine. However, I figured that I might want to use React on the server side as well.

Now, I realise I can create two separate webpack-configures, and then use the babel-loader to transpile the react code on the server side. Is this the best way to go about it? And if so, will the front-end React recognise the React served from the backend, allowing me to modify components etc.?

Thanks in advance, I'm a bit confused on all this. I saw some tutorials on creating an isomorphic react app, but all this strikes me as fairly advanced and I'd like to keep it simple for now.

Best, Daan