How to use transition with image opacity? #447
Unanswered
fsharpn00b
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm trying to create a dissolve effect between two images by using a transition with the opacity property of each image.
However, while one image replaces the other as expected, there is no transition. The change happens at once.
AI (o1) tells me this is because my controls are re-rendered each time my state changes. It suggested various ways to have each Image control retain the same instance across renders, but I can't get any of them to work.
let
statement. However, if I do that, I can't have theImage.opacity
property reference my writable state (which I obtain fromIComponentContext.useState
).Here is my code (adapted from the counter example.
I've been looking at code examples for hours, including discussions here about controlling rendering behavior, but haven't found anything that seems analogous to this (or that I can hack together in a way to make this work). Any help much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions