We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbd86f9 commit b8a367cCopy full SHA for b8a367c
1 file changed
src/components/resources/CodingWithAgents.tsx
@@ -1,4 +1,4 @@
1
-import { useEffect, useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
2
import codingResources from '../../data/resources/coding-with-agents.json';
3
import {
4
listSeries,
@@ -42,8 +42,12 @@ const CodingWithAgents = () => {
42
const [selectedEpisode, setSelectedEpisode] = useState<number | null>(null);
43
const [error, setError] = useState<string | null>(null);
44
45
- const sortedResources = [...codingResources].sort(
46
- (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(),
+ const sortedResources = useMemo(
+ () =>
47
+ [...codingResources].sort(
48
+ (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(),
49
+ ),
50
+ [],
51
);
52
53
const getLinkText = (type: string) => {
0 commit comments