turn custom fallback as function

This commit is contained in:
Pig Fang 2020-02-06 14:54:23 +08:00
parent 5b7055611d
commit a5085af86c
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ function loadModules() {
route.react as (() => Promise<{ default: React.ComponentType }>)
)
const Root = () => (
<React.Suspense fallback={route.frame ?? ''}>
<React.Suspense fallback={route.frame?.() ?? ''}>
<Component />
</React.Suspense>
)

View File

@ -14,7 +14,7 @@ export default [
path: 'user',
react: () => import('../views/user/Dashboard'),
el: '#usage-box',
frame: (
frame: () => (
<div className="card card-primary card-outline">
<div className="card-header">&nbsp;</div>
<div className="card-body"></div>