Compose Quick Summary

k_hyun·2023년 6월 14일
0

https://youtu.be/fFLBCgoHHys

Summary

Create composables using the @Composable annotation

It's quick & easy to create composables

Composables accept parameters

- Use MutableState and remember
- remember the value and not reset when recomposed
- but it wont surive configuration changes
- To remember values from across config changes, use rememberSaveable
// example
val selectedAnswer: Answer? by rememberSaveable { mutableStateOf<Answer>(null)}

Composable should be side-effect free

Composables can

Execute in any order
Run in parallel

- 병렬적으로 실행

Be skipped

- 값의 변경이 있는 부분만 recompose한다.

Run frequently

0개의 댓글