blob: 7bf659897db6fa7933ce701761c713211994bf76 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import { createContext, useContext, useState } from 'react'
const ProductContext = createContext()
export const ProductProvider = ({ children }) => {
const [product, setProduct] = useState(null)
return (
<ProductContext.Provider value={{ product, setProduct }}>{children}</ProductContext.Provider>
)
}
export const useProductContext = () => {
return useContext(ProductContext)
}
|