A Beginner Guide to Compose Locals!

Поділитися
Вставка
  • Опубліковано 7 лют 2025

КОМЕНТАРІ • 6

  • @tonnie7079
    @tonnie7079 23 дні тому +1

    Powerful compose feature explained in a super easy-to-understand way, I came here struggling but now I know something more.

  • @skarloti
    @skarloti 3 місяці тому +2

    While CompositionLocal can make testing more difficult due to implicit state and dependencies, using techniques like CompositionLocalProvider or manually overriding values during tests can help alleviate some of these challenges. However, for most stateful composables, hoisting state is generally preferred for its testability and transparency.

  • @BHARATGARANDE
    @BHARATGARANDE 3 місяці тому

    Sir waiting for next one..

  • @Benianus3D
    @Benianus3D 3 місяці тому

    I hope that you do a playlist about jetpack compose

  • @robchr
    @robchr 3 місяці тому +1

    Per the documentation a CompositionLocal should have a good default value. Avoid CompositionLocal for concepts that aren't thought as tree-scoped or sub-hierarchy scoped. A CompositionLocal makes sense when it can be potentially used by any descendant, not by a few of them. This example is not how it should be used.

    • @CharfaouiYounes
      @CharfaouiYounes  3 місяці тому +1

      This example is to show how the feature work, but the use cases may differ from one to one.