imgix / react-imgix

React component to display imgix images
https://www.npmjs.com/package/react-imgix
Other
360 stars 64 forks source link

How to allow `onLoad` callback on Background component #924

Closed mmarzullotv closed 1 year ago

mmarzullotv commented 1 year ago

I'm using a Background component and noticed that when I tried to add the onLoad as part of the htmlAttributes it didn't work. But when I checked the rendered DOM, it makes sense it's not working as it's a div with inline-style along with the CSS background property.

Is there any way we could convert the rendered to an img node instead of a div? I wanted to add some transition effects as soon as the image loaded in a precise way.

Thanks in advance.