-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having an error using the custom login page shown in the docs #5098
Comments
Thanks for reporting. The doc is missing the import of the theme. You should add: import theme from './theme'; And add this file with your theme. |
Thanks for the follow, i already add the theme file and imported in the App.js, the error is not longer visible but the custom login page still not work, this is the theme.js
|
Hi @tomasalonz55, can you open a CodeSandbox reproducing the issue or at least paste your You can use the React Admin Template. Thanks :) |
@Luwangel I've created a CodeSandbox demo for this. What I did is take the template you mentioned, add I'd appreciate any help on this issue! :) |
Hello @Shark, I think you got the wrong issue, or maybe you encountered the same problem as @tomasalonz55 ? In any case, your |
@jdemangeon @fzaninotto I've forked that sandox above created and applied the changes suggested in the docs and it was still rendering just the inputs. Thanks in advance |
In case it helps anyone else, here's some notes from my recent work in this area.
Then CustomLoginForm is a copy of the standard source taken from https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/auth/LoginForm.tsx - this is where the username/password fields and submit button are. Its a slight pity that the default padlock icon that appears on the top of the login form actually comes from the Login component and not the LoginForm - and no option to switch it off or change it - and I don't want to have a custom version of that in my code. The red box in the pic attached shows the scope of LoginForm, the rest comes from Login (the MUI Card component and padlock icon) |
@andrewlorenz how did you import the copy of
And here is the import statement:
|
hey @yaron2 I didn't ! Here's my "code complete":
I've snipped out the main body of my actual custom login form as that's specific to my application, but you can see how the pieces fit together and what other imports you might need. HtH |
Thanks! |
I'm having these error when trying to use the custom login page on Docs
Gave me this error
index.js:1 Warning: Failed prop type: The prop theme is marked as required in ThemeProvider, but its value is undefined.
This is the code in the docs.
Other information:
Environment
in ThemeProvider (at MyLoginPage.js:18)
in MyLoginPage (created by Context.Consumer)
in Route (created by CoreAdminUI)
in Switch (created by CoreAdminUI)
in CoreAdminUI (created by AdminUI)
in AdminUI (created by Admin)
in Router (created by ConnectedRouter)
in ConnectedRouter (created by Context.Consumer)
in ConnectedRouterWithContext (created by ConnectFunction)
in ConnectFunction (created by CoreAdminContext)
in TranslationProvider (created by CoreAdminContext)
in Provider (created by CoreAdminContext)
in CoreAdminContext (created by AdminContext)
in AdminContext (created by Admin)
in Admin (at App.js:34)
in App (at src/index.js:9)
in StrictMode (at src/index.js:8)
The text was updated successfully, but these errors were encountered: