From 42633ce1ed2f8c7774cd634927cd12d667593079 Mon Sep 17 00:00:00 2001 From: "UZU, J" Date: Mon, 11 Apr 2022 22:36:33 +0900 Subject: [PATCH] fix: handle shorted framework name from query --- .../codeui-code-options-control/code-options-control.tsx | 6 +++--- .../codeui-code-options-control/framework-options.ts | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/editor/components/codeui-code-options-control/code-options-control.tsx b/editor/components/codeui-code-options-control/code-options-control.tsx index fd5c3cbf..2cc5850a 100644 --- a/editor/components/codeui-code-options-control/code-options-control.tsx +++ b/editor/components/codeui-code-options-control/code-options-control.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import React, { useEffect } from "react"; import { IField, LanguageType, Option } from "@code-ui/docstring/dist/lib/type"; import { Docstring as DocstringView } from "@code-ui/docstring"; import { @@ -32,13 +32,13 @@ export function CodeOptionsControl(props: CodeOptionsControlProps) { all_preset_options_map__prod[__presetname] ); - assert(useroption, "option must be specified"); - useEffect(() => { // trigger initial value props.onUseroptionChange(useroption); }, []); + assert(useroption, "option must be specified"); + // FIXME: this should be fixed on https://github.com/gridaco/code-like-ui (view CURSOR) const __dirty_sort_framework = (): Option[] => { const presets = [ diff --git a/editor/components/codeui-code-options-control/framework-options.ts b/editor/components/codeui-code-options-control/framework-options.ts index 9658472b..4644749b 100644 --- a/editor/components/codeui-code-options-control/framework-options.ts +++ b/editor/components/codeui-code-options-control/framework-options.ts @@ -126,7 +126,9 @@ export const all_preset_options__prod = [ export const all_preset_options_map__prod = { none: null, + flutter: flutter_presets.flutter_default, flutter_default: flutter_presets.flutter_default, + react: react_presets.react_default, react_default: react_presets.react_default, react_with_styled_components: react_presets.react_with_styled_components, react_with_inline_css: react_presets.react_with_inline_css,