Created
March 31, 2022 00:03
-
-
Save cindywu/7704da4347033880a6f8aeb573efd9da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { | |
| createContext, | |
| useContext, | |
| ReactNode | |
| } from 'react' | |
| type WorkspaceContextType = { | |
| } | |
| const defaultContextValue = { | |
| } | |
| export const WorkspaceContext = createContext<WorkspaceContextType>(defaultContextValue) | |
| type WorkspaceProviderProps = { | |
| children: ReactNode | |
| } | |
| export const WorkspaceProvider = ({ children } : WorkspaceProviderProps) => { | |
| const workspaceContextValue = { | |
| } | |
| return ( | |
| <WorkspaceContext.Provider | |
| value={workspaceContextValue} | |
| > | |
| {children} | |
| </WorkspaceContext.Provider> | |
| ) | |
| } | |
| export const useWorkspace = () => useContext(WorkspaceContext) | |
| export default WorkspaceProvider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment