fix(client): variable component string value (#5704)

This commit is contained in:
Junyi 2024-11-21 20:36:11 +08:00 committed by GitHub
parent 9e1b0e8d04
commit 9f0add7fc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,7 +223,8 @@ function useVariablesFromValue(value: string, delimiters: [string, string] = ['{
export function TextArea(props) {
const { wrapSSR, hashId, componentCls } = useStyles();
const { value = '', scope, onChange, changeOnSelect, style, fieldNames, delimiters = ['{{', '}}'] } = props;
const { scope, onChange, changeOnSelect, style, fieldNames, delimiters = ['{{', '}}'] } = props;
const value = typeof props.value === 'string' ? props.value : props.value == null ? '' : props.value.toString();
const variables = useVariablesFromValue(value, delimiters);
const inputRef = useRef<HTMLDivElement>(null);
const [options, setOptions] = useState([]);