diff --git a/sandpack-react/src/presets/Sandpack.tsx b/sandpack-react/src/presets/Sandpack.tsx index 26c788ea8..8aad01872 100644 --- a/sandpack-react/src/presets/Sandpack.tsx +++ b/sandpack-react/src/presets/Sandpack.tsx @@ -93,6 +93,11 @@ export const Sandpack: SandpackInternal = (props) => { height: props.options?.editorHeight, // use the original editor height }; + const rightColumnProps = React.useMemo( + () => (hasRightColumn ? { style: rightColumnStyle } : {}), + [hasRightColumn] + ); + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ const templateFiles = SANDBOX_TEMPLATES[props.template!] ?? {}; const mode = "mode" in templateFiles ? templateFiles.mode : "preview"; @@ -128,7 +133,7 @@ export const Sandpack: SandpackInternal = (props) => { /> {/* @ts-ignore */} - + {mode === "preview" && (