November 2018
Beginner
502 pages
10h 22m
English
Consuming a HOC is very simple. We simply wrap the HOC around the component that we want to enhance. The easiest place to do this is in the export statement.
Let's add the withLoader HOC we created in the previous section to our product page:
import withLoader from "./withLoader";
export default withLoader(Product);
We now get a compilation error in the ProductPage component because it expects to pass Product a loading property.
Read now
Unlock full access