This repository was archived by the owner on Apr 3, 2025. It is now read-only.
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
Uh oh!
There was an error while loading. Please reload this page.
-
@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, andtitleprops are just passed directly to theimgtag. Instead of handling them individually, we could switch to accepting an object calledimgAttributesas a prop which would allow users to include any img or global attributes. I left outsrc,width, andheightbecause 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
sourcetag 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