Skip to content

Commit

Permalink
Fix typescript 5.0 breaking change - forbidden implicit coercions in …
Browse files Browse the repository at this point in the history
…relational operators
  • Loading branch information
MajorLift committed Jul 22, 2024
1 parent 3178d79 commit 06784ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const BaseNode: FunctionComponent<BaseNodeProps> = ({
borderColor="border.default"
display={isDragging ? 'none' : 'flex'}
marginX="4"
cursor={node.id > 1 ? 'move' : 'default'}
cursor={Number(node.id) > 1 ? 'move' : 'default'}
>
<Icon icon={node.data.type.toLowerCase() as IconName} width="16px" />
<Text
Expand All @@ -53,7 +53,7 @@ export const BaseNode: FunctionComponent<BaseNodeProps> = ({
{node.data.type}
</Text>
{children}
{node.id >= 2 && (
{Number(node.id) >= 2 && (
<Icon
icon="cross"
width="11px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const NodeTree: FunctionComponent<NodeTreeProps> = ({

const handleCanDrag = (node?: NodeModel<JSXElement>) => {
if (node) {
return node.id >= 2;
return Number(node.id) >= 2;
}

return false;
Expand All @@ -113,7 +113,7 @@ export const NodeTree: FunctionComponent<NodeTreeProps> = ({
return (
canDropElement(dropTarget?.data, dragSource?.data) &&
dropTarget?.droppable &&
dropTargetId > 0
Number(dropTargetId) > 0
);
}

Expand Down

0 comments on commit 06784ef

Please sign in to comment.