File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,14 @@ export interface ThemeConfig {
43
43
| FooterConfig
44
44
| ( ( ctx : ThemeContextValue ) => FooterConfig | null | undefined )
45
45
/**
46
- * View to be rendered when app in 404 state
46
+ * Component to be rendered when app in 404 state
47
47
* (url not matching any page)
48
48
*/
49
49
Component404 ?: React . ComponentType < React . PropsWithChildren < unknown > >
50
+ /**
51
+ * Component to be rendered when app is loading js bundle
52
+ */
53
+ ComponentLoading ?: React . ComponentType < React . PropsWithChildren < unknown > >
50
54
/**
51
55
* Wrap the App with custom Component.
52
56
* You can use `useThemeCtx()` in it to get context info
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export function createTheme(
29
29
30
30
const location = useLocation ( )
31
31
useIsomorphicLayoutEffect ( ( ) => {
32
- // scroll to anchor after page component loaded
32
+ // scroll to anchor link after page component loaded
33
33
if ( loadState . type === 'loaded' ) {
34
34
if ( location . hash ) {
35
35
AnchorLink . scrollToAnchor ( decodeURIComponent ( location . hash . slice ( 1 ) ) )
@@ -40,7 +40,10 @@ export function createTheme(
40
40
} , [ loadState , location . hash ] )
41
41
42
42
if ( loadState . type === 'loading' ) {
43
- return < AppLayout > </ AppLayout >
43
+ const ComponentLoading = themeConfig . ComponentLoading
44
+ return (
45
+ < AppLayout > { ComponentLoading ? < ComponentLoading /> : null } </ AppLayout >
46
+ )
44
47
}
45
48
46
49
if ( loadState . type === 'load-error' ) {
You can’t perform that action at this time.
0 commit comments