- The render method just returns another custom component called that receives the categories data and looks like this: – – The above component iterates over the list of categories that it receives as a prop and calls another custom component called to render a single category element.
- First, we need to make the connection with Redux by wrapping our main app component into a global store: – – In this example, the global app store will contain a list of categories and a list of products, which are merged together using the method from Redux.
- The reducer is just a function that listens to particular actions and changes a portion of the global state, in this case the list of products.
- That’s because the product list component is directly linked to the global app state, also using Redux.
- In this way, it can access the products data directly from the app store, iterate over the list of products and use a component to render a single product element.
Progressive Web Apps combine the best of the web and the best of apps. Here’s how to build them on WordPress and WooCommerce (code examples).
Continue reading “Want to Build Progressive Web Apps Based on WordPress and WooCommerce? Here’s How (w/ Code Examples)”