From f90ec98c509fad7146c169d8d762b4c847d07af8 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 15 Sep 2023 09:15:54 +0700 Subject: Add product context provider --- src/contexts/ProductContext.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/contexts/ProductContext.js (limited to 'src/contexts') 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 ( + {children} + ) +} + +export const useProductContext = () => { + return useContext(ProductContext) +} -- cgit v1.2.3