3 ms·
How would it decide? What does the server-side version do since it won't have access to the req or res objects at this level of the code? If the /api/user/:id r
by idbehold 10y ago
How would it decide? What does the server-side version do since it won't have access to the req or res objects at this level of the code? If the /api/user/:id route is restricted based on the cookies that get sent, how/where do you validate that the user is allowed to get data from that route when rendering server-side?
- Touche 10y agoThat would be the responsibility of the route code, not the code doing the fetch().
- idbehold 10y agoWhy would the route code need to know what data a deeply nested component needs? Making that the responsibility of the route code entirely defeats the purpose of an isomorphic/universal React application.