[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
Sathya Gunasekaran committed
Nov 16, 2023 at 12:01 UTC
eacf189eca0af417f3250b9bbf15a987e3710da3
1 file changed
+2
-14
compiler/apps/playground/components/Editor/Output.tsx
+2
-14
@@ -17,7 +17,7 @@ import { type CompilerError } from "babel-plugin-react-forget";
17
import parserBabel from "prettier/plugins/babel";
18
import * as prettierPluginEstree from "prettier/plugins/estree";
19
import * as prettier from "prettier/standalone";
20
-import { memo, useCallback, useEffect, useState } from "react";
20
+import { memo, useEffect, useState } from "react";
21
import { type Store } from "../../lib/stores";
22
import TabbedWindow from "../TabbedWindow";
23
import { monacoOptions } from "./monacoOptions";
@@ -187,12 +187,6 @@ function Output({ store, compilerOutput }: Props) {
187
});
188
}, [store.source, compilerOutput]);
189
190
- const consoleLogError = useCallback(() => {
191
- if (compilerOutput.kind === "err") {
192
- console.error(compilerOutput.error);
193
- }
194
- }, [compilerOutput]);
195
-
190
return (
191
<>
192
<TabbedWindow
@@ -213,13 +207,7 @@ function Output({ store, compilerOutput }: Props) {
207
className="p-4 basis-full text-red-600 overflow-y-scroll whitespace-pre-wrap"
208
style={{ width: "calc(100vw - 650px)", height: "150px" }}
209
>
216
- <button
217
- className="text-left"
218
- title="Log error to console"
219
- onClick={() => consoleLogError()}
220
- >
221
- <code>{compilerOutput.error.toString()}</code>
222
- </button>
210
+ <code>{compilerOutput.error.toString()}</code>
211
</pre>
212
</div>
213
) : null}