Sufyan Sattar
09/19/2022, 2:51 PMJorge Cordero Camarena
09/19/2022, 3:16 PMSufyan Sattar
09/19/2022, 3:17 PMCasey Brooks
09/19/2022, 3:25 PMCompositionLocals
(locally-scoped) rather than accessing anything globally, and everything else is passed explicitly through function parameters. There’s nothing in the Compose APIs that breaks this rule.
If you are letting your Composable functions access top-level or global properties, that’s a problem with how you’re using it, not a problem with Compose itself. The docs make it very clear that Composable functions should never access global variablesSufyan Sattar
09/19/2022, 3:35 PMChrimaeon
09/19/2022, 3:49 PMprivate
and only the file you declared it can access it. 🤷🏼‍♂️Casey Brooks
09/19/2022, 3:50 PMobject
, mark them internal/private, do whatever you need to make sure functions are only used on the screen they’re intended for. This is no different from how you’d scope your ViewModels or utility functions that are only used on one screenSufyan Sattar
09/19/2022, 3:53 PMSufyan Sattar
09/19/2022, 3:53 PM