title: When recomposition happens exactly? with changing the state or also with changing the input
body: <p>As far as I understood, each part of code which is related to any state will be changed(recomposed) with state changes →</p>
  <p>And each state is an observable and the dependent UI part observes that state and is subscribed to it(the state) and whenever the state changes it will be notified(redrawing that part of UI) and happening recomposition.</p>
  <p>But here in this article of google <a href="https://developer.android.com/jetpack/compose/mental-model#recomposition" rel="nofollow noreferrer">Thinking in compose</a>, it says that recomposition happens with changing input, so I am confused.</p>
  <blockquote>
  <p>Recomposition is the process of calling your composable functions again <strong>when inputs change</strong>. This happens when the function's inputs change. When Compose recomposes based on new inputs, it only calls the functions or lambdas that might have changed, and skips the rest. By skipping all functions or lambdas that don't have changed parameters, Compose can recompose efficiently.</p>
  </blockquote>
  <p>Also, here in other <a href="https://developer.android.com/codelabs/jetpack-compose-state?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fcompose%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fjetpack-compose-state#7" rel="nofollow noreferrer">sample of compose-roadmap</a>, encourage hoisting the state to make the composable function stateless to avoid recompositions</p>
  <p>So it would be great, if someone can make it clear that the recompositions happens only with state changes or input changes also causes?</p>
  <p>Thank you in advance for your help</p>