Browse Source

fix ts-error

AykutSarac 3 years ago
parent
commit
b3e01e98d3

+ 1 - 1
src/containers/LiveEditor/CustomNode/ObjectNode.tsx

@@ -2,7 +2,7 @@ import React from "react";
 import { CustomNodeProps } from ".";
 import * as Styled from "./styles";
 
-const ObjectNode: React.FC<CustomNodeProps<[string, unknown][]>> = ({
+const ObjectNode: React.FC<CustomNodeProps<[string, string][]>> = ({
   width,
   height,
   value,

+ 1 - 1
src/containers/LiveEditor/CustomNode/index.tsx

@@ -27,7 +27,7 @@ export const CustomNode = React.memo((nodeProps: NodeProps) => {
         const { width, height } = nodeProps;
 
         if (data.text instanceof Object) {
-          const entries = Object.entries(data.text);
+          const entries = Object.entries<string>(data.text);
           return (
             <ObjectNode
               x={nodeProps.x}