Build a Reusable Product Card Skeleton Loader
In e-commerce, a smooth user experience is paramount. When product data is being fetched, displaying a blank screen or a generic spinner can feel slow and unengaging. Skeleton loaders address this by providing a visual placeholder that mimics the structure of the content being loaded, improving perceived performance and user satisfaction. For a platform like Myntra, this is crucial for product listing pages (PLPs) where many items load simultaneously.
Your task is to implement a reusable ProductCardSkeleton component that provides a visual placeholder for product cards while data is loading.
ProductCardSkeleton Component: Implement a React functional component named ProductCardSkeleton in App.tsx.App.tsx: Conditionally render multiple instances of your ProductCardSkeleton component when data is loading, and switch to rendering actual ProductCard components once the data is available.ProductCardSkeleton should have distinct placeholder shapes (e.g., a square/rectangle for the image, lines of varying widths for text, etc.) that roughly correspond to where content will eventually appear in a real product card.ProductCardSkeleton component is defined and renders correctly.App component correctly displays multiple ProductCardSkeleton components when isLoading is true.App component correctly displays actual ProductCard components with mock data when isLoading becomes false.isLoading state.Constraints
ProductCard component are provided.setTimeout) is already set up in App.tsx.ProductCardSkeleton component and its integration, not complex data fetching or routing.ProductCard beyond basic display.ProductCardSkeleton).Loading editor...