diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-09-15 02:29:14 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-09-15 02:29:14 +0000 |
| commit | d6f88923e194d841d68030a18c305a2fdb558fa1 (patch) | |
| tree | ba9dbba7ae89c35d01bc4bb3f92d09de53f06385 /src/contexts | |
| parent | 6b4a109615799bd6994499c62221b635c9539898 (diff) | |
| parent | e5c08cb213d0c6dbfa5a931e03eeccac518ddba1 (diff) | |
Merged in CR/migrasi_product_detail_to_solr (pull request #68)
CR/migrasi product detail to solr
Diffstat (limited to 'src/contexts')
| -rw-r--r-- | src/contexts/ProductContext.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/contexts/ProductContext.js b/src/contexts/ProductContext.js new file mode 100644 index 00000000..7bf65989 --- /dev/null +++ b/src/contexts/ProductContext.js @@ -0,0 +1,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) +} |
