1
1
import * as React from 'react' ;
2
- import {
3
- createElement ,
4
- FunctionComponent ,
5
- ComponentType ,
6
- useMemo ,
7
- useEffect ,
8
- } from 'react' ;
2
+ import { createElement , ComponentType , useMemo , useEffect } from 'react' ;
9
3
import { Switch , Route } from 'react-router-dom' ;
10
4
11
5
import CoreAdminRouter from './CoreAdminRouter' ;
@@ -24,9 +18,7 @@ import {
24
18
25
19
export type ChildrenFunction = ( ) => ComponentType [ ] ;
26
20
27
- const DefaultLayout : FunctionComponent < CoreLayoutProps > = ( { children } ) => (
28
- < > { children } </ >
29
- ) ;
21
+ const DefaultLayout = ( { children } : CoreLayoutProps ) => < > { children } </ > ;
30
22
31
23
export interface AdminUIProps {
32
24
catchAll ?: CatchAllComponent ;
@@ -47,21 +39,23 @@ export interface AdminUIProps {
47
39
// for BC
48
40
export type CoreAdminUIProps = AdminUIProps ;
49
41
50
- const CoreAdminUI : FunctionComponent < AdminUIProps > = ( {
51
- catchAll = Noop ,
52
- children,
53
- customRoutes = [ ] ,
54
- dashboard,
55
- disableTelemetry = false ,
56
- layout = DefaultLayout ,
57
- loading = Noop ,
58
- loginPage = false ,
59
- logout,
60
- menu, // deprecated, use a custom layout instead
61
- ready = Ready ,
62
- theme,
63
- title = 'React Admin' ,
64
- } ) => {
42
+ const CoreAdminUI = ( props : AdminUIProps ) => {
43
+ const {
44
+ catchAll = Noop ,
45
+ children,
46
+ customRoutes = [ ] ,
47
+ dashboard,
48
+ disableTelemetry = false ,
49
+ layout = DefaultLayout ,
50
+ loading = Noop ,
51
+ loginPage = false ,
52
+ logout,
53
+ menu, // deprecated, use a custom layout instead
54
+ ready = Ready ,
55
+ theme,
56
+ title = 'React Admin' ,
57
+ } = props ;
58
+
65
59
const logoutElement = useMemo ( ( ) => logout && createElement ( logout ) , [
66
60
logout ,
67
61
] ) ;
0 commit comments