Skip to content

Commit

Permalink
Move ErrorBoundary so live preview can recover
Browse files Browse the repository at this point in the history
  • Loading branch information
meyer committed Jun 4, 2022
1 parent 61586ce commit 107b770
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions minisite/pages/code-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const CodePreviewPage: React.FC = () => {
if (element) {
setTranspiledCode({
css,
component: () => element,
component: () => <ErrorBoundary>{element}</ErrorBoundary>,
});
} else {
setTranspiledCode({
Expand Down Expand Up @@ -113,9 +113,7 @@ const CodePreviewPage: React.FC = () => {

return (
<Col gap={20} padding={20}>
<ErrorBoundary>
<transpiledCode.component />
</ErrorBoundary>
<transpiledCode.component />
<CodeModule title="Extracted CSS" code={transpiledCode.css} />
<style jsx global>
{`
Expand Down

0 comments on commit 107b770

Please sign in to comment.