You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suppose the first question is what onMounted supports. It seems like it breaks React abstractions to some degree. I wasn't able to find discussion on its genesis, either.
I've been working through fixing StrictMode issues in my own project, and findDOMNode in this library is one of the things it's complaining about. If onMounted is critical functionality, it should be implemented with refs. If it's not, can it be deprecated?
I'll submit a PR.
The text was updated successfully, but these errors were encountered:
Ahhhh this is one from a while ago, but I believe the reason it was implemented was so that developers could hook into the root img tag and say, add a onLoad handler for their own use.
We could also probably use a ref here instead of a callback.
i.e. instead of this...
// In consuming code...<ImgixonMounted={(img: HTMLImageElement)=>{}}/>
we support this...
// In consuming code...<Imgixref={(img: HTMLImageElement)=>{}}/>
This is imo more idiomatic React code these days.
This would also technically be a breaking change because ref would right now point to the instance of the Imgix component. My gut feeling is that 0.0001% of people would use the ref in this way, so the impact is minimal. The alternative is to call the ref prop something else, like htmlRef, which would not be a breaking change.
I suppose the first question is what
onMounted
supports. It seems like it breaks React abstractions to some degree. I wasn't able to find discussion on its genesis, either.I've been working through fixing StrictMode issues in my own project, and
findDOMNode
in this library is one of the things it's complaining about. IfonMounted
is critical functionality, it should be implemented withref
s. If it's not, can it be deprecated?I'll submit a PR.
The text was updated successfully, but these errors were encountered: