Skip to content

Commit

Permalink
Updated dependencies & tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
SanichKotikov committed Jul 26, 2019
1 parent 2c03307 commit 835850f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 45 deletions.
63 changes: 35 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-family-tree",
"version": "1.2.0",
"version": "1.3.0",
"description": "React component that renders a family tree",
"main": "lib/index.js",
"typings": "index.d.ts",
Expand Down Expand Up @@ -31,12 +31,12 @@
"url": "https://github.com/SanichKotikov/react-family-tree/issues"
},
"devDependencies": {
"@types/react": "16.7.18",
"react": "16.7.0",
"typescript": "3.2.2"
"@types/react": "16.8.23",
"react": "16.8.6",
"typescript": "3.5.3"
},
"dependencies": {
"relatives-tree": "1.2.0"
"relatives-tree": "1.3.2"
},
"homepage": "https://github.com/SanichKotikov/react-family-tree"
}
8 changes: 3 additions & 5 deletions src/connector.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import { IConnector } from 'relatives-tree';

interface Props {
Expand All @@ -7,7 +7,7 @@ interface Props {
height: number;
}

const Connector: React.FunctionComponent<Props> = ({ connector, width, height }) => {
export default React.memo<Props>(function Connector({ connector, width, height }) {
const [x1, y1, x2, y2] = connector.points;

return (
Expand All @@ -22,6 +22,4 @@ const Connector: React.FunctionComponent<Props> = ({ connector, width, height })
}}
/>
);
};

export default Connector;
});
8 changes: 3 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import relTree, { IFamilyNode, IFamilyExtNode } from 'relatives-tree';
import Connector from './connector';

Expand All @@ -11,7 +11,7 @@ interface Props {
renderNode: (node: IFamilyExtNode) => void;
}

const ReactFamilyTree: React.FunctionComponent<Props> = (props) => {
export default React.memo<Props>(function ReactFamilyTree(props) {
const data = relTree(props.nodes, props.rootId);

const width = props.width / 2;
Expand All @@ -37,6 +37,4 @@ const ReactFamilyTree: React.FunctionComponent<Props> = (props) => {
{data.nodes.map(props.renderNode)}
</div>
);
};

export default ReactFamilyTree;
});
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"compilerOptions": {
"rootDir": "src",
"target": "es6",
"module": "commonjs",
"module": "es6",
"moduleResolution": "node",
"lib": ["es6"],
"lib": ["es6", "es7"],
"jsx": "react",
"outDir": "lib",
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"alwaysStrict": true,
"sourceMap": false,
Expand Down

0 comments on commit 835850f

Please sign in to comment.