in your code?
Isn't it problematic to put in the slots inside the ComposeView the whole view in which this ComposeView is in?
What do I miss here? 🤔
m
mohamed rejeb
07/22/2024, 9:26 AM
You don't need this, just use it directly. The whole screen should recompose if something from Composition Locals changes (including LocalView)
s
Stylianos Gakis
07/22/2024, 10:13 AM
The suggested:
Copy code
val view = LocalView.current
val foo = remember { view... }
Won't re-run the remember if LocalView recomposes and you'll end up referencing the old view inside there.
Be careful with that.
m
mohamed rejeb
07/22/2024, 10:26 AM
Hmmm I thought that composition locals are treated in a special way unlike states.
s
Stylianos Gakis
07/22/2024, 10:40 AM
Yeah it will re-compose as you say. But you got a remember which does not have it as a key. So it won't magically re-run the remember lambda. All the normal state rules apply here, nothing special with composition locals.