File tree Expand file tree Collapse file tree 1 file changed +16
-22
lines changed Expand file tree Collapse file tree 1 file changed +16
-22
lines changed Original file line number Diff line number Diff line change @@ -30,33 +30,32 @@ export function Preview({
30
30
className = {
31
31
"ch-preview" + ( className ? " " + className : "" )
32
32
}
33
- { ...rest }
34
33
>
35
- { ! presetConfig ? (
36
- < MiniBrowser
37
- loadUrl = { show }
38
- children = { children }
39
- theme = { codeConfig . theme }
40
- />
41
- ) : (
42
- < SandpackPreview
43
- files = { files }
44
- presetConfig = { presetConfig }
45
- codeConfig = { codeConfig }
46
- />
47
- ) }
34
+ < MiniBrowser
35
+ loadUrl = { show }
36
+ theme = { codeConfig . theme }
37
+ { ...rest }
38
+ children = {
39
+ presetConfig ? (
40
+ < SandpackPreview
41
+ files = { files }
42
+ presetConfig = { presetConfig }
43
+ />
44
+ ) : (
45
+ children
46
+ )
47
+ }
48
+ />
48
49
</ div >
49
50
)
50
51
}
51
52
52
53
function SandpackPreview ( {
53
54
files,
54
55
presetConfig,
55
- codeConfig,
56
56
} : {
57
57
files : EditorStep [ "files" ]
58
58
presetConfig : PresetConfig
59
- codeConfig : { theme : EditorTheme }
60
59
} ) {
61
60
const iframeRef = React . useRef < HTMLIFrameElement > ( null ! )
62
61
const clientRef = React . useRef < SandpackClient > ( null ! )
@@ -85,12 +84,7 @@ function SandpackPreview({
85
84
}
86
85
} , [ files ] )
87
86
88
- return (
89
- // TODO only render iframe here, leave MiniBrowser for the parent component
90
- < MiniBrowser theme = { codeConfig . theme } >
91
- < iframe ref = { iframeRef } />
92
- </ MiniBrowser >
93
- )
87
+ return < iframe ref = { iframeRef } />
94
88
}
95
89
96
90
function mergeFiles (
You can’t perform that action at this time.
0 commit comments