Skip to content

Trouble understanding srcSet usage with this library #273

Closed Answered by igordanchenko
RickeyWard asked this question in Q&A
Discussion options

You must be logged in to vote

am I misunderstanding how this works? width and height seem to be required if using srcset and they need to be accurate.

That's right. To utilize the built-in responsive images with automatic resolution switching, you must populate srcSet attribute with accurate src, width, and height values. srcSet is not required, but it helps optimize network bandwidth and improve user experience.

What is the right way to handle showing whatever image is available and also a thumbnail version for save on loading if they don't scroll through all the thumbs?

You can provide whatever image URL is available in the src prop. In this case, the same image will be rendered as both main image and thumbnail.…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@RickeyWard
Comment options

@igordanchenko
Comment options

@RickeyWard
Comment options

@igordanchenko
Comment options

@RickeyWard
Comment options

Answer selected by RickeyWard
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants