Appendix B. Server-side React Router
From an isomorphic app standpoint, one of the difficult parts of moving to React Router 4 is that the maintainers and community at large have yet to arrive at a consistent set of best practices for data prefetching patterns. You’ll see this sentiment over and over in the documentation; for instance, the React Router Config readme file states: “There are a lot of ways to do server rendering with data and pending navigation, and we haven’t settled on one.”
Chapter 7 teaches you how to prefetch data on the server so that it’s available at render time. This appendix shows you how to do that with React Router 4. The code for the example here can be found in the repo at http://mng.bz/S3N0, in branch chapter-7-complete-react-router-4 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access