Combine (almost) all individual image props into a single imgAttributes prop #77
laurenashpole
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
It sounds great, ill start it right away |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@viniciuscasarin Sorry for the delay starting this discussion! The last couple weeks were busier than expected. If you're still interested and have the time, here's what I was thinking for the next major version update:
Right now the
srcSet
,sizes
,alt
, andtitle
props are just passed directly to theimg
tag. Instead of handling them individually, we could switch to accepting an object calledimgAttributes
as a prop which would allow users to include any img or global attributes. I left outsrc
,width
, andheight
because a) it seems like the src prop should still be required and b) width and height are used in other places to create the loading spacer.As part of this, it might also make sense to update the
source
tag to pass in props using a spread operator instead of individual attributes to make that more flexible too.I'd love to hear what you (or anyone else who wants to jump in) think. And no pressure if you don't have the time to work on this right now, just let me know and I can take a look.
Beta Was this translation helpful? Give feedback.
All reactions