---
title: "Discussion on \"Pass by Value vs CompositionLocal vs Static CompositionLocal\" | Hashnode"
description: "Discussion on \"Pass by Value vs CompositionLocal vs Static CompositionLocal\". Examples to show how to pass data to composable functions using function parameters(i.e. pass by value), CompositionLocal and static CompositionLocal"
url: "https://hashnode.com/posts/pass-by-value-vs-compositionlocal-vs-static-compositionlocal/6439e927f49f45ac4100432d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Pass by Value vs CompositionLocal vs Static CompositionLocal](https://vtsen.hashnode.dev/pass-by-value-vs-compositionlocal-vs-static-compositionlocal?utm_source=hashnode&utm_medium=feed)

Examples to show how to pass data to composable functions using function parameters(i.e. pass by value), CompositionLocal and static CompositionLocal

Apr 15, 2023 · 5 min read · vtsen.hashnode.dev  
Updated May 5, 2023  
Read the article

-   [#jetpack-compose](https://hashnode.com/tag/jetpack-compose)
-   [#android-app-development](https://hashnode.com/tag/android-app-development)
-   [#android](https://hashnode.com/tag/android)
-   [#android-development](https://hashnode.com/tag/android-development)
-   [#composition](https://hashnode.com/tag/composition)

## Written by

[Vincent Tsen](https://hashnode.com/@vtsen)

@vtsen · Sydney

  
[View profile](https://hashnode.com/@vtsen)

Native Android Kotlin Developer

I'm a self-taught hobbyist Android developer who loves to build projects and share valuable tips for new Android developers. Feel free to comment, share or connect with me!

## Responses 1

Markdown supported · ⌘↵ to post

[Alek](https://hashnode.com/@alekkuningan)

[Apr 19, 2023](https://hashnode.com/posts/pass-by-value-vs-compositionlocal-vs-static-compositionlocal/6439e927f49f45ac4100432d/comment/643fa411f06b44fb4fcfdce9)

Hay Vincent, i have problem with compose, i have small app like cart, but i need the price is editable in textfield, i try to resolve but still failed, can you give me some insight to do it thanks

[Vincent Tsen](https://hashnode.com/@vtsen)

[Apr 20, 2023](https://hashnode.com/posts/pass-by-value-vs-compositionlocal-vs-static-compositionlocal/6439e927f49f45ac4100432d/comment/643fa411f06b44fb4fcfdce9#reply-64412bc65e1cdf14b5563c7f)

I'm not sure if I can help, but something like this will do.

```
@Composable
fun SimpleFilledTextFieldSample() {
    var text by remember { mutableStateOf("Hello") }

    TextField(
        value = text,
        onValueChange = { text = it },
        label = { Text("Label") }
    )
}
```
