MCPcopy
hub / github.com/facebook/react / AppShell

Function AppShell

packages/react-reconciler/src/__tests__/useEffectEvent-test.js:796–805  ·  view source on GitHub ↗
({children})

Source from the content-addressed store, hash-verified

794 const ShoppingCartContext = createContext(null);
795
796 function AppShell({children}) {
797 const [items, updateItems] = useState([]);
798 const value = useMemo(() => ({items, updateItems}), [items, updateItems]);
799
800 return (
801 <ShoppingCartContext.Provider value={value}>
802 {children}
803 </ShoppingCartContext.Provider>
804 );
805 }
806
807 function Page({url}) {
808 const {items, updateItems} = useContext(ShoppingCartContext);

Callers

nothing calls this directly

Calls 2

useStateFunction · 0.50
useMemoFunction · 0.50

Tested by

no test coverage detected