'init'
This commit is contained in:
11
app/providers/ImageViewerProvider/useImageViewer.ts
Normal file
11
app/providers/ImageViewerProvider/useImageViewer.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useContext } from "react";
|
||||
import { ImageViewerContext } from "./ImageViewerProvider";
|
||||
|
||||
export function useImageViewer() {
|
||||
const context = useContext(ImageViewerContext);
|
||||
if(!context){
|
||||
throw new Error("useImageViewer must be used within a ImageViewerProvider");
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user