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 trialNat Feibish
Full Stack JavaScript Techdegree Student 4,830 PointsQuestion before learning React -- SSR vs CSR?
Hey, friends. I'm new to React (like very new) but am very familiar with traditional HTML/CSS/JS. I'm starting to learn React here on Treehouse, but at this point it looks like learning JSX, not so much the birds-eye view.
What I'm curious about is SSR vs. CSR. Currently I work with a large number of clients and I push the HTML/CSS/JS to their LMS, and life is good. Now the LMS I use (Instructure Canvas) is offering a React framework (InstructureUI), and I need to figure out if this is something I can use since we don't really offer a hosting server for anything. I produce code that the clients host and run. Canvas is slowly cutting out the HTML/CSS/JS, and the LMS doesn't have a means to run React natively.
So is the "give code to the client" still a possibility via CSR? Or should I accept that I am going to need a hosting server for SSR? All this will be doing is building pages for courses with your basic text, images, maybe multimedia and such. No database calls or anything like that.
1 Answer
Rohald van Merode
Treehouse StaffHey Nat Feibish 👋
JSX is indeed introduced early in our React Basics course because it's essential for describing the UI in React apps. As you progress, you'll also learn about essential concepts like components, state, and props, which will give you a broader understanding of React's capabilities.
With Client-Side Rendering (CSR), which is our focus in our React content, your React code compiles into JavaScript files that are loaded by the client's browser. Running the build
command results in static files (HTML, CSS, JS) contained in a build folder. By doing this you can certainly continue to "give code to the client" just like you have with traditional HTML/CSS/JS. 🙂
Server-Side Rendering (SSR) is often facilitated by frameworks build on top of React (Next.js for example). Currently, our courses focus primarily on CSR because it covers the needs of most beginners and is simpler to manage without a server.
Hope this answers your question 😃