Skip to content

Commit

Permalink
docs(suspensive.org): remove ClientOnly in Sandpack
Browse files Browse the repository at this point in the history
  • Loading branch information
manudeli committed Aug 24, 2024
1 parent dc6cc73 commit b112bac
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions docs/suspensive.org/src/components/Sandpack/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
type SandpackProviderProps,
} from '@codesandbox/sandpack-react'
import { atomDark } from '@codesandbox/sandpack-themes'
import { ClientOnly } from '@suspensive/react'
import { baseTemplate } from './baseTemplate'
import { CustomPreset } from './CustomPreset'

Expand All @@ -25,37 +24,35 @@ interface SandpackProps extends Omit<SandpackProviderProps, 'template' | 'custom

export const Sandpack = (props: SandpackProps) => {
return (
<ClientOnly>
<SandpackProvider
template="react-ts"
theme={atomDark}
{...props}
files={{
...baseTemplate.files,
...(props.files || {}),
}}
customSetup={{
dependencies: {
...baseTemplate.dependencies,
...props.dependencies,
},
devDependencies: {
...baseTemplate.devDependencies,
...props.devDependencies,
},
}}
options={{
initMode: 'user-visible',
initModeObserverOptions: { rootMargin: '1400px 0px' },
...props.providerOptions,
}}
>
<CustomPreset
layoutOptions={props.layoutOptions}
editorOptions={props.editorOptions}
previewOptions={props.previewOptions}
/>
</SandpackProvider>
</ClientOnly>
<SandpackProvider
template="react-ts"
theme={atomDark}
{...props}
files={{
...baseTemplate.files,
...(props.files || {}),
}}
customSetup={{
dependencies: {
...baseTemplate.dependencies,
...props.dependencies,
},
devDependencies: {
...baseTemplate.devDependencies,
...props.devDependencies,
},
}}
options={{
initMode: 'user-visible',
initModeObserverOptions: { rootMargin: '1400px 0px' },
...props.providerOptions,
}}
>
<CustomPreset
layoutOptions={props.layoutOptions}
editorOptions={props.editorOptions}
previewOptions={props.previewOptions}
/>
</SandpackProvider>
)
}

0 comments on commit b112bac

Please sign in to comment.