We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d110f8e commit e0d320eCopy full SHA for e0d320e
1 file changed
.agents/review-checklists/react/code-quality.md
@@ -80,11 +80,16 @@ const Counter: FC = () => {
80
};
81
82
// ❌ Custom hook with async logic but no tests
83
-const useCustomFetch = (url: string) => {
+const useItemData = (id: string) => {
84
const [data, setData] = useState(null);
85
useEffect(() => {
86
- fetch(url).then(res => res.json()).then(setData);
87
- }, [url]);
+ // Error handling omitted for brevity
+ async function load() {
88
+ const result = await loadItemById(id);
89
+ setData(result);
90
+ }
91
+ load();
92
+ }, [id]);
93
return data;
94
95
```
0 commit comments