Why are neither src nor name props for the avatar machine? #3104
-
|
Hi, I find it quite peculiar that neither I'd be grateful if you could share some insight on that. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
trackSrcChange({ send, scope }) {
const imageEl = dom.getImageEl(scope)
return observeAttributes(imageEl, {
attributes: ["src", "srcset"],
callback() {
send({ type: "src.change" })
},
})
},Ok I think I found how the machine can influence the src attribute. |
Beta Was this translation helpful? Give feedback.
-
|
This is because most users will use their frameworks' Image component, and we don't want to dictate how the image src is set. Some libraries expand the src into src and srcSet, and even add the We'd rather not handle how images are loaded and focus on the loading lifecycle of the image/avatar instead. |
Beta Was this translation helpful? Give feedback.
This is because most users will use their frameworks' Image component, and we don't want to dictate how the image src is set. Some libraries expand the src into src and srcSet, and even add the
pictureelement.We'd rather not handle how images are loaded and focus on the loading lifecycle of the image/avatar instead.