why is img onLoad not triggerring #10137
Unanswered
accountunavaible
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Every component is a client component in Remix, otherwise your effect wouldn't work. The most likely reason is that the image loads before React hydrates the app, so the load even already happened. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
hi all,
I am trying to add a loading effect to img element, I have built out a component wiht state of isLoading, but I am having issue that img onLoad event is not triggering (so that my isLoading state is always true). Has anyone having same issue?
I have to use useEffect for walkaround ( I need to add ref, add eventListener to the ref, and a function, which is so crazy), is there anything that I can mark this component as client component so it will trigger the event?
thanks
Beta Was this translation helpful? Give feedback.
All reactions