-
-
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
Add support for lazy-loaded React components #9260
Conversation
expect(screen.queryByText('PostList')).not.toBeNull() | ||
); | ||
}); | ||
it('should show a loader when requireAuth is true and dataProvider.checkAuth() takes more than 1s to reply', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was testing that CoreAdminRouter displays the loader only after 1s. Now, this feature has moved to the Loader itself.
@@ -340,7 +309,7 @@ describe('<CoreAdminRoutes>', () => { | |||
</CoreAdminContext> | |||
); | |||
expect(screen.queryByText('PostList')).toBeNull(); | |||
expect(screen.queryByText('Loading')).toBeNull(); | |||
expect(screen.queryByText('Loading')).not.toBeNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no delay, the test loader (which is NOT our <Loading>
component) is shown right away
Problem
To use lazy-loaded commponents as Resource routes, developers must override the default layout to add
<Suspense>
.Solution
<Suspense>
in the default layout<Loading>
so that it can be used directly as Suspense fallback