diff --git a/src/ValueNodeWrapper.tsx b/src/ValueNodeWrapper.tsx index fc294538..0247231a 100644 --- a/src/ValueNodeWrapper.tsx +++ b/src/ValueNodeWrapper.tsx @@ -275,7 +275,7 @@ export const ValueNodeWrapper: React.FC = (props) => { ) : ( // Need to re-fetch data type to make sure it's one of the "core" ones // when fetching a non-custom component - getInputComponent(getDataType(data) as DataType, inputProps) + getInputComponent(data, inputProps) ) return ( @@ -403,15 +403,15 @@ const getDataType = (value: unknown, customNodeData?: CustomNodeData) => { return 'invalid' } -const getInputComponent = (dataType: DataType, inputProps: InputProps) => { - const value = inputProps.value +const getInputComponent = (data: JsonData, inputProps: InputProps) => { + const dataType = getDataType(data) switch (dataType) { case 'string': - return + return case 'number': - return + return case 'boolean': - return + return case 'null': return default: