{"record":{"id":"53a4d1673c37164d","repo":"marmelab/react-admin","slug":"you-passed-true-to-the-loginpage-prop-you-must-ei","errorCode":null,"errorMessage":"You passed true to the loginPage prop. You must either pass false to disable it or a component class to customize it","messagePattern":"You passed true to the loginPage prop\\. You must either pass false to disable it or a component class to customize it","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/react-admin/src/Admin.tsx","lineNumber":127,"sourceCode":"        disableTelemetry,\n        error,\n        i18nProvider = defaultI18nProvider,\n        layout,\n        lightTheme,\n        loading,\n        loginPage,\n        notification,\n        queryClient,\n        ready,\n        requireAuth,\n        routerProvider,\n        store = defaultStore,\n        theme,\n        title = 'React Admin',\n    } = props;\n\n    if (loginPage === true && process.env.NODE_ENV !== 'production') {\n        console.warn(\n            'You passed true to the loginPage prop. You must either pass false to disable it or a component class to customize it'\n        );\n    }\n\n    return (\n        <AdminContext\n            authProvider={authProvider}\n            basename={basename}\n            darkTheme={darkTheme}\n            dataProvider={dataProvider}\n            defaultTheme={defaultTheme}\n            i18nProvider={i18nProvider}\n            lightTheme={lightTheme}\n            queryClient={queryClient}\n            routerProvider={routerProvider}\n            store={store}\n            theme={theme}\n        >","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/marmelab/react-admin/blob/051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0/packages/react-admin/src/Admin.tsx#L109-L145","documentation":"In development, Admin warns when the loginPage prop is set to the boolean true. The loginPage prop only accepts false (to disable the login page) or a React component (to replace the default login page); true is meaningless because react-admin cannot render the boolean as a page. The warning is suppressed in production builds.","triggerScenarios":"Passing loginPage={true} (or loginPage as an untyped/unknown value coerced to true, e.g. a truthy non-component like an empty string from a boolean flag) to <Admin>.","commonSituations":"Misreading documentation and thinking true means 'enable the default login page'; conditional props like loginPage={hasAuth && true} where a component was intended; legacy code after a refactor where the custom Login component was removed, leaving the boolean flag.","solutions":["Remove the loginPage prop entirely — the default login page is rendered automatically, no need for true.","Pass loginPage={false} to disable the login page.","Pass a component: <Admin loginPage={MyLogin} ...> to customize it.","Check any conditional logic producing the value and make sure it yields a component or false, not true."],"exampleFix":"// before\n<Admin loginPage={true} authProvider={authProvider}>\n\n// after (default login page)\n<Admin authProvider={authProvider}>\n\n// or custom login page\n<Admin loginPage={MyLoginPage} authProvider={authProvider}>","handlingStrategy":"type-guard","validationCode":"const isValidLoginPage = (p: unknown): boolean =>\n  p === undefined || p === false || (typeof p === 'function' && typeof p !== 'boolean');\nif (!isValidLoginPage(props.loginPage)) throw new Error('loginPage must be false or a component');","typeGuard":"const isComponent = (v: unknown): v is React.ComponentType =>\n  typeof v === 'function' || (typeof v === 'object' && v !== null && 'render' in v);","tryCatchPattern":null,"preventionTips":["Type the prop as false | React.ComponentType so TS rejects true.","Never pass true to boolean-or-component props; omit the prop for default behavior.","Enable react-admin's dev warnings locally and address them before production builds."],"tags":["react-admin","props","login","dev-warning"],"backgroundTag":"invalid-prop-value","analyzedSha":"051f511bb0afb5ea565c2d3728bf4dab0a6fa5e0","analyzedAt":"2026-08-30T02:28:14.926Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}