diff --git a/packages/astro/src/default/components/WorkspacePanelWrapper.tsx b/packages/astro/src/default/components/WorkspacePanelWrapper.tsx index 39d37343..01fa4a3c 100644 --- a/packages/astro/src/default/components/WorkspacePanelWrapper.tsx +++ b/packages/astro/src/default/components/WorkspacePanelWrapper.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import { useStore } from '@nanostores/react'; import { WorkspacePanel } from '@tutorialkit/components-react'; import type { Lesson } from '@tutorialkit/types'; @@ -11,7 +12,13 @@ interface Props { export function WorkspacePanelWrapper({ lesson }: Props) { const theme = useStore(themeStore); - tutorialStore.setLesson(lesson, { ssr: import.meta.env.SSR }); + useEffect(() => { + tutorialStore.setLesson(lesson); + }, [lesson]); + + if (import.meta.env.SSR || !tutorialStore.lesson) { + tutorialStore.setLesson(lesson, { ssr: import.meta.env.SSR }); + } return ; } diff --git a/packages/components/react/src/Panels/PreviewPanel.tsx b/packages/components/react/src/Panels/PreviewPanel.tsx index a0b6b088..1e8313e5 100644 --- a/packages/components/react/src/Panels/PreviewPanel.tsx +++ b/packages/components/react/src/Panels/PreviewPanel.tsx @@ -134,6 +134,7 @@ export const PreviewPanel = memo( return createElement(PanelGroup, { id: 'preview-panel', direction: 'horizontal' }, ...children); }), ); +PreviewPanel.displayName = 'PreviewPanel'; interface PreviewProps { iframe: IFrameRef; diff --git a/packages/components/react/src/core/Terminal/index.tsx b/packages/components/react/src/core/Terminal/index.tsx index 713f673f..5d82ad82 100644 --- a/packages/components/react/src/core/Terminal/index.tsx +++ b/packages/components/react/src/core/Terminal/index.tsx @@ -83,4 +83,5 @@ export const Terminal = forwardRef( }, ); +Terminal.displayName = 'Terminal'; export default Terminal;