Add type annotation for product fetching in CreateRecipePage component
This commit is contained in:
@@ -18,7 +18,7 @@ export default function CreateRecipePage() {
|
|||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchJson('/api/products')
|
fetchJson<Product[]>('/api/products')
|
||||||
.then(setProducts)
|
.then(setProducts)
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Reference in New Issue
Block a user