Skip to content

Commit 54b4537

Browse files
committed
Update ValueNodeWrapper.tsx
1 parent 503aa7e commit 54b4537

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ValueNodeWrapper.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ export const ValueNodeWrapper: React.FC<ValueNodeProps> = (props) => {
201201
const handleCancel = () => {
202202
setCurrentlyEditingElement(null)
203203
setValue(data)
204-
setDataType(getDataType(data, customNodeData))
205204
}
206205

207206
const handleDelete = () => {
@@ -274,7 +273,7 @@ export const ValueNodeWrapper: React.FC<ValueNodeProps> = (props) => {
274273
) : (
275274
// Need to re-fetch data type to make sure it's one of the "core" ones
276275
// when fetching a non-custom component
277-
getInputComponent(data, inputProps)
276+
getInputComponent(dataType, inputProps)
278277
)
279278

280279
return (
@@ -402,8 +401,7 @@ const getDataType = (value: unknown, customNodeData?: CustomNodeData) => {
402401
return 'invalid'
403402
}
404403

405-
const getInputComponent = (data: JsonData, inputProps: InputProps) => {
406-
const dataType = getDataType(data)
404+
const getInputComponent = (dataType: string, inputProps: InputProps) => {
407405
const { value } = inputProps
408406
switch (dataType) {
409407
case 'string':

0 commit comments

Comments
 (0)