Creating a Universal JavaScript app
At this stage of the chapter, we should have got most of the basics that we need to transform our sample app into a full Universal JavaScript app. We met Webpack, ReactJs, and analyzed most of the patterns that help us to uniform and differentiate the code between platforms as needed.
In this section, we will keep improving our example by creating reusable components, by adding universal routing and rendering, and finally universal data retrieval.
Creating reusable components
In the previous example, we created two very similar components: JoyceBooks
and WellsBooks
. These two components are almost identical; the only difference between them is that they use different data. Now imagine a real case scenario where ...
Get Node.js Design Patterns - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.