Learning Android Development

Exploring Unconventional Compose’s Remember and Recomposition

Some interesting behavior observed on basic Remember and Recomposition through some unconventional flow.

Photo by Ellen Bordal on Unsplash

In Jetpack Compose, Remember and Recomposition is the most basic element we should learn about.

Check the below out for some basic if you need recall some basic of it

While exploring it, I notice some interesting findings as below. Check it out and see if this is align with your understanding.

Case 1: Breaking through the Remember Barrier

We know that, if we have

val a = remember(b) { c }

the a will always be c and it will not change unless we give a different b

Let’s explore some scenarios below

Accessing through an internal variable

--

--