misc: added descriptive error message

This commit is contained in:
Sheen Capadngan
2024-05-07 15:21:17 +08:00
parent a9b72b2da3
commit 536f51f6ba

View File

@@ -70,7 +70,7 @@ export const StoreProvider = ({ children }: { children: ReactNode }) => {
const useStoreContext = <T extends unknown>(selector: (state: SelectedEntriesState) => T): T => {
const ctx = useContext(StoreContext);
if (!ctx) throw new Error("Missing ");
if (!ctx) throw new Error("Missing context provider");
return useStore(ctx, selector);
};