← React Beginner Questions - Set 10 Q91
React Beginner Questions - Set 10
1 2 3 4 5 6
const CartContext = createContext({ items: [] }); function Badge() { const { items } = useContext(CartContext); return <span>{items.length}</span>; }