Skip to content

Commit dbc09b5

Browse files
committed
Make useIsGov return true when not in the custom provider
1 parent 2d995ea commit dbc09b5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/mui.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -584,14 +584,10 @@ export function createDsfrCustomBrandingProvider(params: {
584584
return { DsfrCustomBrandingProvider };
585585
}
586586

587-
const context_isGov = createContext<boolean | undefined>(undefined);
587+
const context_isGov = createContext<boolean>(true);
588588

589589
export function useIsGov() {
590590
const isGov = useContext(context_isGov);
591591

592-
if (isGov === undefined) {
593-
throw new Error("useIsGov must be used within a MuiThemeProvider");
594-
}
595-
596592
return { isGov };
597593
}

0 commit comments

Comments
 (0)