refactor & perf: declare const object outside component ConstantField (#17495)

This commit is contained in:
yusheng chen 2025-04-07 10:12:35 +08:00 committed by GitHub
parent 6d59b8d85b
commit bf69b97639
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,8 +15,10 @@ type Props = {
onChange: (value: string | number, varKindType: VarKindType, varInfo?: Var) => void onChange: (value: string | number, varKindType: VarKindType, varInfo?: Var) => void
} }
const DEFAULT_SCHEMA = {} as CredentialFormSchema
const ConstantField: FC<Props> = ({ const ConstantField: FC<Props> = ({
schema = {} as CredentialFormSchema, schema = DEFAULT_SCHEMA,
readonly, readonly,
value, value,
onChange, onChange,