Skip to content
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

Lazy initialization of resources stuck in loading if no resources #6079

Closed
HALLERPierre opened this issue Mar 25, 2021 · 0 comments · Fixed by #6112
Closed

Lazy initialization of resources stuck in loading if no resources #6079

HALLERPierre opened this issue Mar 25, 2021 · 0 comments · Fixed by #6112
Assignees
Labels

Comments

@HALLERPierre
Copy link

What you were expecting:
Our goal is to create a page with no authentication needed (a forgot password page). We created a route with a noLayout props and we made sure that our getPermissions function in the authProvider did not throw an exception if the user has none. Then we give an empty array of resources to the admin component.

What happened instead:
When I go on the custom route, the admin is stuck on loading.

Steps to reproduce:
Pass an empty array as children to the admin component.

Related code:

<RA.Admin
    customRoutes={[
                <Router.Route exact path="/test" component={Test} noLayout />
    ]}
    ...
>
    {(role: string) => {
        switch (role) {
            case 'admin':
                return [<RA.Resource ...];
            case 'visitor':
                // Here is the bug :
                return [];
   

Environment

  • React-admin version: 3.13.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants