Skip to content

Instantly share code, notes, and snippets.

@cindywu
Created March 31, 2022 00:03
Show Gist options
  • Select an option

  • Save cindywu/7704da4347033880a6f8aeb573efd9da to your computer and use it in GitHub Desktop.

Select an option

Save cindywu/7704da4347033880a6f8aeb573efd9da to your computer and use it in GitHub Desktop.
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