Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/ValueNodeWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export const ValueNodeWrapper: React.FC<ValueNodeProps> = (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 (
Expand Down Expand Up @@ -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 <StringValue {...inputProps} value={value as string} />
return <StringValue {...inputProps} value={data as string} />
case 'number':
return <NumberValue {...inputProps} value={value as number} />
return <NumberValue {...inputProps} value={data as number} />
case 'boolean':
return <BooleanValue {...inputProps} value={value as boolean} />
return <BooleanValue {...inputProps} value={data as boolean} />
case 'null':
return <NullValue {...inputProps} />
default:
Expand Down