1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-24 06:54:27 +07:00

fix: fix DependencyBlock props interface

This commit is contained in:
Antoine Chalifour 2019-10-03 13:39:10 +02:00 committed by antoinechalifour
parent b35baa069f
commit 35d691c1e0

View File

@ -96,14 +96,16 @@ class Dependencies extends Component {
const dependencyMap = { dependencies, devDependencies, peerDependencies };
const dependencyList = Object.keys(dependencyMap).reduce((result, value, key) => {
const selectedDepndency = dependencyMap[value];
if (selectedDepndency && this.checkDependencyLength(selectedDepndency)) {
// @ts-ignore
result.push(<DependencyBlock className="dependency-block" dependencies={selectedDepndency} key={key} title={value} />);
}
return result;
}, []);
const dependencyList = Object.keys(dependencyMap).reduce(
(result, value, key) => {
const selectedDepndency = dependencyMap[value];
if (selectedDepndency && this.checkDependencyLength(selectedDepndency)) {
result.push(<DependencyBlock dependencies={selectedDepndency} key={key} title={value} />);
}
return result;
},
[] as JSX.Element[]
);
if (dependencyList.length) {
return <Fragment>{dependencyList}</Fragment>;