Let's put what we have learned about component patterns to the test with some questions:
- What special property does React give us to access a component's, children?
- How many components can share state with React context?
- When consuming the React context, what pattern does it use to allow us to render our content with the context?
- How many render props can we have in a component?
- How many children props do we have in a component?
- We only used withLoader on the product page. We use the following function in ProductData.ts to get all the products:
export const getProducts = async (): Promise<IProduct[]> => {
await wait(1000);
return products;
};
Can you use this to implement a loader spinner on the products page by consuming the withLoader HOC?
- Is it possible to create a loader spinner using the children props pattern? The consuming JSX would be something...