Skip to content
Discussion options

You must be logged in to vote

So, in trying to conditionally render the (Sk)Image: I understand that using state makes more sense for that, but I'm also updating the rasterImg (SkImage) in an useFrameCallback very frequently. From what I read, changing it to a state variable would force me to make each update in a runOnJs.

Can you get the null value later on in the frame callback or is that just an initial value? If that's just an initial value, then I'd suggest to implement your second proposed solution:

Tie a state variable to the shared value used only for conditional rendering. Linter is not too happy about that, though, since it has no way to know one guards the other (and I don't like seeing red in my files 🙂)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@FlawTECH
Comment options

@MatiPl01
Comment options

Answer selected by FlawTECH
@FlawTECH
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants