https://kotlinlang.org logo
Title
b

Big Chungus

05/05/2022, 11:18 AM
Is there a way to implicity pass some data to parent composable without hoisting the state? I basically need to let the parent know if it contains a specific kind of optional child composable.
a

Albert Chang

05/05/2022, 12:22 PM
Check
Modifier.layoutId()
and
ParentDataModifier
.
b

Big Chungus

05/05/2022, 12:35 PM
That's not something I can use, unfortunately as I'm working in compose-web context. I need something more generic.
a

Albert Chang

05/05/2022, 12:41 PM
Then you should ask in #compose-web as it's (almost) a completely different thing.
b

Big Chungus

05/05/2022, 1:06 PM
It's not a web specific issue though. I just need a solution that only uses compose runtime and not android/desktop specific constructs
a

Albert Chang

05/05/2022, 1:33 PM
I don't think there's such a way. Compose runtime has no knowledge of actual parent/child nodes and apparently compose desktop/Android and compose web use different node types.
c

Casey Brooks

05/05/2022, 2:22 PM
I wonder if there’s anything like
SubcomposeLayout
for web?
z

Zach Klippenstein (he/him) [MOD]

05/10/2022, 3:05 PM
Why don't you want to hoist your state?