1. Interfaces for Component Props
interface ProductProps {
name: string;
price: number;
imageUrl: string;
inStock: boolean;
}
1. Interfaces for Component Props
interface ProductProps {
name: string;
price: number;
imageUrl: string;
inStock: boolean;
}
useState
, useReducer
, and useContext
to ensure state management aligns with expected data types.