diff --git a/dist/providers/Config/index.js b/dist/providers/Config/index.js index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000001 100644 --- a/dist/providers/Config/index.js +++ b/dist/providers/Config/index.js @@ -69,8 +69,8 @@ export const PageConfigProvider = t0 => { config: configFromProps } = t0; - const { - config: rootConfig, - setConfig: setRootConfig - } = useConfig(); + const _configCtx = useConfig(); + const rootConfig = _configCtx?.config; + const setRootConfig = _configCtx?.setConfig; let t1; let t2; if ($[0] !== configFromProps || $[1] !== setRootConfig) { @@ -89,7 +89,7 @@ export const PageConfigProvider = t0 => { } useEffect(t1, t2); - if (rootConfig !== configFromProps && rootConfig.unauthenticated !== configFromProps.unauthenticated) { + if (rootConfig && rootConfig !== configFromProps && rootConfig.unauthenticated !== configFromProps.unauthenticated) { let t3; if ($[4] !== children || $[5] !== configFromProps) { t3 = _jsx(ConfigProvider, { diff --git a/dist/providers/ListQuery/context.js b/dist/providers/ListQuery/context.js index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000002 100644 --- a/dist/providers/ListQuery/context.js +++ b/dist/providers/ListQuery/context.js @@ -1,4 +1,4 @@ import { createContext, use } from 'react'; -export const ListQueryContext = createContext({}); +export const ListQueryContext = createContext({ query: {}, handleSortChange: () => {}, handlePageChange: () => {}, handlePerPageChange: () => {}, handleSearchChange: () => {}, handleWhereChange: () => {}, handleGroupByChange: () => {} }); export const useListQuery = () => use(ListQueryContext); export const ListQueryModifiedContext = createContext(false); diff --git a/dist/providers/Theme/index.js b/dist/providers/Theme/index.js index b09ace810d007cf0896c84b2e5f6e721a18cac25..8f9c2732b89b994cb3665c7b46dae5c1482c072b 100644 --- a/dist/providers/Theme/index.js +++ b/dist/providers/Theme/index.js @@ -37,11 +37,10 @@ export const ThemeProvider = t0 => { children, theme: initialTheme } = t0; - const { - config - } = useConfig(); - const preselectedTheme = config.admin.theme; - const cookieKey = `${config.cookiePrefix || "payload"}-theme`; + const configCtx = useConfig(); + const config = configCtx?.config; + const preselectedTheme = config?.admin?.theme; + const cookieKey = `${config?.cookiePrefix || "payload"}-theme`; const [theme, setThemeState] = useState(initialTheme || defaultTheme); const [autoMode, setAutoMode] = useState(); let t1;