From eacf189eca0af417f3250b9bbf15a987e3710da3 Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Thu, 16 Nov 2023 12:01:59 +0000 Subject: [PATCH] [playground] Remove button from error message We show the entire error in panel, no need to click to console.log This makes it easier to copy the error now. Before: https://github.com/facebook/react-forget/assets/565765/4c13abfe-a06d-4580-b3d7-b02792f53e57 After: https://github.com/facebook/react-forget/assets/565765/0dff95cc-5207-48a5-a0b6-2055cadcb780 --- .../apps/playground/components/Editor/Output.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/compiler/apps/playground/components/Editor/Output.tsx b/compiler/apps/playground/components/Editor/Output.tsx index 6313620893..03bfd7df21 100644 --- a/compiler/apps/playground/components/Editor/Output.tsx +++ b/compiler/apps/playground/components/Editor/Output.tsx @@ -17,7 +17,7 @@ import { type CompilerError } from "babel-plugin-react-forget"; import parserBabel from "prettier/plugins/babel"; import * as prettierPluginEstree from "prettier/plugins/estree"; import * as prettier from "prettier/standalone"; -import { memo, useCallback, useEffect, useState } from "react"; +import { memo, useEffect, useState } from "react"; import { type Store } from "../../lib/stores"; import TabbedWindow from "../TabbedWindow"; import { monacoOptions } from "./monacoOptions"; @@ -187,12 +187,6 @@ function Output({ store, compilerOutput }: Props) { }); }, [store.source, compilerOutput]); - const consoleLogError = useCallback(() => { - if (compilerOutput.kind === "err") { - console.error(compilerOutput.error); - } - }, [compilerOutput]); - return ( <> - + {compilerOutput.error.toString()} ) : null}