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
@@ -48,13 +48,16 @@ const generatedColumns: TableColumn[] = [
field: 'message',
highlight: true,
render: (row: Partial<WorkflowRun>) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const routeLink = useRouteRef(buildRouteRef);
return (
<Link component={RouterLink} to={routeLink({ id: row.id! })}>
{row.message}
</Link>
);
const LinkWrapper: React.FC<{}> = () => {
const routeLink = useRouteRef(buildRouteRef);
return (
<Link component={RouterLink} to={routeLink({ id: row.id! })}>
{row.message}
</Link>
);
};
return <LinkWrapper />;
},
},
{