Skip to content

Commit 7db7d1e

Browse files
author
Martarion-Code
committed
change if statement in jsonVisNode
1 parent 518c0c9 commit 7db7d1e

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useReactFlow,
99
Panel,
1010
} from "reactflow";
11-
import JsonVisNode from "./Custom Nodes/jsonVisNode";
11+
import JsonVisNode from "./Custom-Nodes/jsonVisNode";
1212

1313
// we define the nodeTypes outside of the component to prevent re-renderings
1414
// you could also use useMemo inside the component
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,11 @@ import {Handle} from 'reactflow';
44

55
// eslint-disable-next-line react/prop-types
66
function JsonVisNode({data, targetPosition, sourcePosition}){
7-
8-
// console.log
9-
// console.log(data.label);
107
let str;
11-
if(typeof data.label === 'object'){
12-
str = Object.entries(data.label);
13-
}else{
8+
if(typeof data.label !== 'object'){
9+
1410
str = data.label;
1511
}
16-
17-
// console.log(str);
18-
19-
// const strArr = (typeof data.label === 'object' ) ? data.label?.split(',')
20-
// console.log(strArr)
2112
return (
2213
<>
2314
<Handle type="target" position={targetPosition} ></Handle>

0 commit comments

Comments
 (0)