fix(Variable.Input): fix error
This commit is contained in:
parent
cf4e91b0f2
commit
7bf23964c1
@ -127,7 +127,10 @@ export function Input(props) {
|
|||||||
const isConstant = typeof parsed === 'string';
|
const isConstant = typeof parsed === 'string';
|
||||||
const type = isConstant ? parsed : '';
|
const type = isConstant ? parsed : '';
|
||||||
const variable = isConstant ? null : parsed;
|
const variable = isConstant ? null : parsed;
|
||||||
const variableOptions = useMemo(() => (typeof scope === 'function' ? scope() : scope ?? []), [scope]);
|
|
||||||
|
// 当 scope 是一个函数时,可能是一个 hook,所以不能使用 useMemo
|
||||||
|
const variableOptions = typeof scope === 'function' ? scope() : scope ?? [];
|
||||||
|
|
||||||
const [variableText, setVariableText] = React.useState('');
|
const [variableText, setVariableText] = React.useState('');
|
||||||
|
|
||||||
const loadData = async (selectedOptions: Option[]) => {
|
const loadData = async (selectedOptions: Option[]) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user