Hello. Maybe this question is already asked but re...
# compose
j
Hello. Maybe this question is already asked but really want to see how other people manage this. I need access to navcontroller deep down in child component. I do not want to do react thing “props drill” and that every piece of app knows for navcontroller event it does not need it. Is there any better approach to pass navcontroller deep down? Local composition?
c
j
wow wow thx 😄 … same issue bother us 😄 so props drilling is our solution passing lambda around to component which actually needs it
d
See how I pass events up with very minimal amounts of lambdas here: https://github.com/EricDw/MADPlayground
i
You might look at changing some of your intermediate layers to be more Slot based APIs if you find yourself reusing them in multiple different screens: https://chris.banes.dev/slotting-in-with-compose-ui/
d
@Ian Lake was this comment ☝️ directed at me?
i
Nope, to Jasmin. More that intermediate layers that use slot based APIs don't need to know about passing lambdas, as they work with any content 🙂
d
True
j
thx a lot @Ian Lake. One thing on the same note what is preferred way of sending objects as navigation params or it is better to use something like https://github.com/raamcosta/compose-destinations
i
As per the other thread from yesterday, don't send them at all is the best way https://kotlinlang.slack.com/archives/CJLTWPH7S/p1658736921551749?thread_ts=1658736921.551749&cid=CJLTWPH7S