From b759b71eaded884d61dc2b5e97e73f219ef6a4f5 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Tue, 21 May 2024 17:51:39 -0400 Subject: [PATCH] [compiler:playground] JS tab is expanded by default When using the playground you typically want to see what it outputs, so let's make the JS tab expanded by default. ghstack-source-id: 721bc4c381c50db008058b31e1f976e92eab8548 Pull Request resolved: https://github.com/facebook/react/pull/29203 --- compiler/apps/playground/__tests__/e2e/page.spec.ts | 1 - compiler/apps/playground/components/Editor/Output.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/apps/playground/__tests__/e2e/page.spec.ts b/compiler/apps/playground/__tests__/e2e/page.spec.ts index ef0305a0c4..3bb6637f95 100644 --- a/compiler/apps/playground/__tests__/e2e/page.spec.ts +++ b/compiler/apps/playground/__tests__/e2e/page.spec.ts @@ -28,7 +28,6 @@ test("editor should compile successfully", async ({ page }) => { }); // User input from hash compiles - await page.getByRole("button", { name: /JS/ }).click(); await page.screenshot({ fullPage: true, path: "test-results/01-show-js-before.png", diff --git a/compiler/apps/playground/components/Editor/Output.tsx b/compiler/apps/playground/components/Editor/Output.tsx index 0847e044c5..3ca0942a46 100644 --- a/compiler/apps/playground/components/Editor/Output.tsx +++ b/compiler/apps/playground/components/Editor/Output.tsx @@ -177,7 +177,7 @@ function getSourceMapUrl(code: string, map: string): string | null { } function Output({ store, compilerOutput }: Props) { - const [tabsOpen, setTabsOpen] = useState>(() => new Set()); + const [tabsOpen, setTabsOpen] = useState>(() => new Set(['JS'])); const [tabs, setTabs] = useState>( () => new Map(), );