Fix can not autoload in production mode bug

This commit is contained in:
2024-01-15 15:57:48 +08:00
parent bcf29f74ef
commit 6d08e1a8e8
24 changed files with 36 additions and 57 deletions

View File

@@ -1,7 +1,6 @@
import MonacoEditor from '@monaco-editor/react'
import { Loader } from 'esbuild-wasm'
import '@/components/Playground/Output/Transform/transform.scss'
import { useUpdatedEffect } from '@/util/hooks'
import { IFile, ITheme } from '@/components/Playground/shared'
import { cssToJs, jsonToJs, addReactImport } from '@/components/Playground/files'
import Compiler from '@/components/Playground/compiler'
@@ -32,7 +31,7 @@ const Transform = ({ file, theme }: OutputProps) => {
})
}
useUpdatedEffect(() => {
useEffect(() => {
if (file) {
try {
const code = file.value