From the course: React: Software Architecture
Unlock the full course today
Join today to access over 24,300 courses taught by industry experts.
Rendering server-side API data
From the course: React: Software Architecture
Rendering server-side API data
- [Narrator] So let's take a look at how to have our server actually take care of rendering the data that we've loaded here instead of just placing it in the HTML and having our react app render it after it gets to the client. The solution that we're going to be using here involves using context, which we learned about previously. Essentially, what we're going to do is use context in order to communicate between our front end and our back end while on the server side. Before we move on, though, I think I should probably point out that the reason we have to do this in the first place is that the use effect hook inside our components will not be called when our components are being rendered on the server side. That's just how it works. So basically we need to figure out a different way for our components to get their data when they're being rendered on the server, and as I mentioned, we're going to be using context for that. So…