A Beginner Guide to Compose Locals!

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024
  • In this video, we will see in-depth how you can use an excellent feature of compose to allow us to share some objects within the compose tree to achieve many behaviors; we will see a practical case in this video and how to use it in general, so Enjoy!
    🚀 Online course - Refactoring Legacy Code - bit.ly/47dzTLT
    👾 FREE Interview Question PDF - bit.ly/Android...
    💻 Android Code Review Checklist - bit.ly/android...
    ✅ FREE Notion Compose Checklist - sendfox.com/lp...
    💚 Join my newsletter - bit.ly/YCNewsl...
    👨🏽‍🏭 Who I am:
    I'm Younes Charfaoui, a Software Engineer and an Android Developer. I make videos about Android development, Technology, and productivity for software engineers.
    😋 Be My Friend:
    💻 GitHub - github.com/You...
    🐦 Twitter - / charfaouiyounes
    📑 Medium - / mxcsyounes
    📷 Instagram - / charfaoui.younes
    🌍 My website - www.youneschar...

Комментарии • 5

  • @skarloti
    @skarloti 4 дня назад +1

    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 4 дня назад

    Sir waiting for next one..

  • @Benianus3D
    @Benianus3D 5 дней назад

    I hope that you do a playlist about jetpack compose

  • @robchr
    @robchr 4 дня назад +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  4 дня назад +1

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