Commit fa5bae8 1 parent 8449e29 commit fa5bae8 Copy full SHA for fa5bae8
File tree 1 file changed +15
-1
lines changed
packages/anvil-ui-ft-shell/src
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,20 @@ interface Props extends TDocumentHeadProps {
11
11
enhancedScriptsToLoad : string [ ]
12
12
}
13
13
14
+ function renderComponent ( Component ) {
15
+ if ( typeof Component === 'string' ) {
16
+ return < body dangerouslySetInnerHTML = { { __html : Component } } />
17
+ } else if ( typeof Component === 'function' ) {
18
+ return (
19
+ < body >
20
+ < Component />
21
+ </ body >
22
+ )
23
+ } else {
24
+ return < body > { Component } </ body >
25
+ }
26
+ }
27
+
14
28
export default function Shell ( props : Props ) {
15
29
const coreScripts = [ corePolyfillServiceUrl , ...props . coreScriptsToLoad ]
16
30
const enhancedScripts = [ enhancedPolyfillServiceUrl , ...props . enhancedScriptsToLoad ]
@@ -32,7 +46,7 @@ export default function Shell(props: Props) {
32
46
/>
33
47
< script dangerouslySetInnerHTML = { { __html : getBootstrapJS ( ) } } />
34
48
</ head >
35
- < body > { props . children } </ body >
49
+ { renderComponent ( props . children ) }
36
50
</ html >
37
51
)
38
52
}
You can’t perform that action at this time.
0 commit comments