I was using this in `kotlin-react 754`, but it doe...
# react
r
I was using this in
kotlin-react 754
, but it doesn't compile anymore (
EffectBuilder
was replaced with
CoroutineScope
and
cleanup
function is no longer available):
Copy code
useEffect {
    // ...
    cleanup {
        // ...
    }
}
What should I use now?
Am I correct guessing this is it?:
Copy code
useEffectWithCleanup {
    onCleanup {
    }
}
👌 1
t
Do you update state in
onCleanup
?
r
no
t
Probably you can use
suspend
API (with auto-cleanup) 😉