Skip to content

Instantly share code, notes, and snippets.

@mukeshsolanki
Created May 1, 2022 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mukeshsolanki/39c5e37b95fba0a7c6014ea1cd14d039 to your computer and use it in GitHub Desktop.
Save mukeshsolanki/39c5e37b95fba0a7c6014ea1cd14d039 to your computer and use it in GitHub Desktop.
// ❌
@Composable
fun HelloWorld(): String {
Text("Hello")
Text("World")
return remember { "HelloWorld" }
}
// ✅
@Composable
fun HelloWorld(modifier: Modifier = Modifier) {
Column(modifier = modifier) {
Text("Hello")
Text("World")
}
}
// ✅
@Composable
fun rememberHelloWorld(): String {
return remember { "Hello World" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment