Skip to content

Commit

Permalink
fix: fix preview not visible after error
Browse files Browse the repository at this point in the history
fixes #2154
  • Loading branch information
Thomas Roest committed Jan 19, 2024
1 parent 6e00289 commit e907a94
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client/rsg-components/Preview/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ export default class Preview extends Component<PreviewProps, PreviewState> {
/>
);

/* istanbul ignore next */
window.requestAnimationFrame(() => {
// this.unmountPreview();
if (!this.mountNode) {
return;
}
try {
if (this.mountNode && this.reactRoot) {
if (this.reactRoot === null) {
this.reactRoot = createRoot(this.mountNode);
this.reactRoot.render(wrappedComponent);
} else {
this.reactRoot.render(wrappedComponent);
}
} catch (err) {
Expand Down

0 comments on commit e907a94

Please sign in to comment.