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);
|
||||
|
||||
useEffect(() => {
|
||||
fetchJson('/api/products')
|
||||
fetchJson<Product[]>('/api/products')
|
||||
.then(setProducts)
|
||||
.catch(console.error);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user