Image component is fundamentally flawed #35109
OskarGroth
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
|
I agree, and it also very difficult to use it in Tailwind. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
NextJS Image component is in nutshell, a TRASH |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I have a website that displays an image, and I want to use NextJS Image component to get caching, layout, placeholder, lazy loading, optimization, etc.
The website needs to:
This is required pretty much for any real-world page layout that isn't a Hello World blog example with a hero cover image. Basically any scenario where the developer actually cares to present the image in the optimal size. Take www.apple.com for example.
In Desktop mode:
(hero_iphone_13pro__large_1x, hero_iphone_13pro__large_2x)
In Mobile mode:

(hero_iphone_13pro__mediumtall_1x, hero_iphone_13pro__mediumtall_2x)
In plain old HTML this is as easy as:
But with the NextJS Image component... I've spent a whole day trying to use the NextJS Image component for this purpose, and concluded that it simply isn't possible. The component has zero functionality to support this, in my opinion, baseline use-case for a web image component. Not to mention the series of layout issues that present themselves trying to use it for even basic, non-retina images.
If it is impossible to achieve crisp artwork while using this, what is the point of the component at all?
This has easily been my worst experience trying to develop with NextJS so far. In my opinion, the Image component is over-engineered without getting the fundamentals right. I'd be happy to be proven wrong.
Beta Was this translation helpful? Give feedback.
All reactions