How could I write a test that makes sure I don't a...
# compose
z
How could I write a test that makes sure I don't accidentally introduce extra recompositions? like I have a component that I know should only recompose once, so I want the test to fail if it recomposes more than once, or not at all
y
When I asked or suggested something similar, I got told there isn't any guarantee it doesn't recompose extra times. Just that it does recompose when it needs to.
đź’Ż 1
I think in practice it's safe to test, but I doubt it will be a promoted pattern.
s
I know should only recompose once
Generally speaking you can’t know that What is it that you need to care about recompositions?
c
yeah this is one of those things that i gave up trying to do very early on in compose once jim talked me out of it. basically what Yuri said... you shouldn't care how many times it recomposes. its ultimately out of your control. and you shouldn't try to use recomposition for correctness (or something like that)