December 2019
Intermediate to advanced
474 pages
10h 3m
English
Just as for the list data, the item data could also be stored in Context and passed to the components that need this data. That way, data is no longer fetched from any of the rendered components but from the ContextProvider components in the src/Providers directory:
import React from 'react';import withDataFetching from '../withDataFetching';export const ItemsContext = React.createContext();const ItemsContextProvider = ({ children, data }) => ( <ItemsContext.Provider value={{ items: data }}> { children ...Read now
Unlock full access