Capítulo 14 de 51
A minimal two-part image-with-fallback component: Image renders the picture, Fallback shows automatically (after an optional delay) whenever the image is missing or fails to load — no manual onError state juggling required.
Root → Image (src), Fallback (children shown as fallback, e.g. initials).Image.onLoadingStatusChange: callback for reacting to load-state transitions yourself, in addition to the automatic fallback behavior.Fallback.delay: delays showing the fallback by N ms — avoids a flash of initials while a fast-loading image is still in flight.| Part | Notable props | Notable data attributes |
|---|---|---|
Image | onLoadingStatusChange | data-starting-style, data-ending-style |
Fallback | delay | — |
Fallback.delay (e.g. 200–600ms) in lists of avatars fetched over the network — prevents a flicker of initials before each image finishes loading.className/style/data-* styling contract, nothing Avatar-specific beyond the two attributes above.