chore: remove occurrences of the rule of hooks to favour wrapping the components instead

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-11-18 10:17:15 +01:00
parent f50966e025
commit f029733d13
4 changed files with 65 additions and 53 deletions
@@ -146,19 +146,22 @@ const generatedColumns: TableColumn[] = [
highlight: true,
width: '20%',
render: (row: Partial<CITableBuildInfo>) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const routeLink = useRouteRef(circleCIBuildRouteRef);
const LinkWrapper: React.FC<{}> = () => {
const routeLink = useRouteRef(circleCIBuildRouteRef);
return (
<Link
component={RouterLink}
to={`${routeLink({
buildId: row.id!,
})}`}
>
{row.buildName ? row.buildName : row?.workflow?.name}
</Link>
);
return (
<Link
component={RouterLink}
to={`${routeLink({
buildId: row.id!,
})}`}
>
{row.buildName ? row.buildName : row?.workflow?.name}
</Link>
);
};
return <LinkWrapper />;
},
},
{