File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ import { appLanguages } from './i18n/app-languages';
164164import { themeColors } from './UI/theme-colors' ;
165165import { getCommandMenuActions } from './UI/command-menu-actions' ;
166166import { createLanguageMenus , createProcessorItem } from './UI/create-language-menus' ;
167+ import { hasJsx } from './editor/ts-compiler-options' ;
167168
168169// declare global dependencies
169170declare global {
@@ -370,8 +371,9 @@ const loadModuleTypes = async (
370371 ...config . types ,
371372 ...config . customSettings . types ,
372373 } ;
374+ const reactImport = hasJsx . includes ( scriptLanguage ) ? `import React from 'react';\n` : '' ;
373375 const libs = await typeLoader . load (
374- getConfig ( ) . script . content + '\n' + getConfig ( ) . markup . content ,
376+ reactImport + getConfig ( ) . script . content + '\n' + getConfig ( ) . markup . content ,
375377 configTypes ,
376378 loadAll ,
377379 force ,
You can’t perform that action at this time.
0 commit comments