Skip to content
Snippets Groups Projects
Commit ef6b72ed authored by Zandor Smith's avatar Zandor Smith :computer:
Browse files

Fix hook being called conditionally.

parent 6ea0b32e
No related branches found
No related tags found
No related merge requests found
Pipeline #449999 canceled
......@@ -45,18 +45,22 @@ function Driver({ match }) {
const {
pointsMultiTeam
} = useContext(YearContext);
if(!pointsMultiTeam) {
return null;
}
const driver = match.params.driver?.toUpperCase();
const sortedPoints = useMemo(() => {
if(!pointsMultiTeam) {
return [];
}
return Object.entries(pointsMultiTeam.drivers).sort((driverEntry1, driverEntry2) => {
return driverEntry2[1] - driverEntry1[1];
});
}, [pointsMultiTeam]);
if(!pointsMultiTeam) {
return null;
}
return (
<div className="container mt-3">
<div className="my-3">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment