Skip to content

Commit 835850f

Browse files
committed
Updated dependencies & tsconfig
1 parent 2c03307 commit 835850f

File tree

5 files changed

+49
-45
lines changed

5 files changed

+49
-45
lines changed

package-lock.json

+35-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-family-tree",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "React component that renders a family tree",
55
"main": "lib/index.js",
66
"typings": "index.d.ts",
@@ -31,12 +31,12 @@
3131
"url": "https://github.com/SanichKotikov/react-family-tree/issues"
3232
},
3333
"devDependencies": {
34-
"@types/react": "16.7.18",
35-
"react": "16.7.0",
36-
"typescript": "3.2.2"
34+
"@types/react": "16.8.23",
35+
"react": "16.8.6",
36+
"typescript": "3.5.3"
3737
},
3838
"dependencies": {
39-
"relatives-tree": "1.2.0"
39+
"relatives-tree": "1.3.2"
4040
},
4141
"homepage": "https://github.com/SanichKotikov/react-family-tree"
4242
}

src/connector.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import { IConnector } from 'relatives-tree';
33

44
interface Props {
@@ -7,7 +7,7 @@ interface Props {
77
height: number;
88
}
99

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

1313
return (
@@ -22,6 +22,4 @@ const Connector: React.FunctionComponent<Props> = ({ connector, width, height })
2222
}}
2323
/>
2424
);
25-
};
26-
27-
export default Connector;
25+
});

src/index.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import relTree, { IFamilyNode, IFamilyExtNode } from 'relatives-tree';
33
import Connector from './connector';
44

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

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

1717
const width = props.width / 2;
@@ -37,6 +37,4 @@ const ReactFamilyTree: React.FunctionComponent<Props> = (props) => {
3737
{data.nodes.map(props.renderNode)}
3838
</div>
3939
);
40-
};
41-
42-
export default ReactFamilyTree;
40+
});

tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"compilerOptions": {
33
"rootDir": "src",
44
"target": "es6",
5-
"module": "commonjs",
5+
"module": "es6",
66
"moduleResolution": "node",
7-
"lib": ["es6"],
7+
"lib": ["es6", "es7"],
88
"jsx": "react",
99
"outDir": "lib",
1010
"strictNullChecks": true,
1111
"suppressImplicitAnyIndexErrors": true,
12+
"allowSyntheticDefaultImports": true,
1213
"downlevelIteration": true,
1314
"alwaysStrict": true,
1415
"sourceMap": false,

0 commit comments

Comments
 (0)