title: java.lang.IllegalStateException: Composition requires an active composition context (Android Jetpack Compose)
body: <p>Trying to show an AlertDialog using Jetpack Compose, but App is crashing while calling the AlertDialog function with error as</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: Composition requires an active
    composition context</p>
  </blockquote>
  
  <p>Please find the code below,</p>
  
  <pre><code>@Composable
  fun homeScreenCompose() {
  
      Align(
          alignment = Alignment.Center
      ) {
          Column(
              arrangement = Arrangement.Center,
              modifier = Spacing(16.dp),
              children = {
  
                  Button(
                      modifier = Height(50.dp) wraps Expanded,
                      text = "Alert Dialog", onClick = {
                          showAlertDialog()
                      }, style = OutlinedButtonStyle(
                          Border(color = Color.Red, width = 1.dp),
                          shape = RoundedCornerShape(50), //50% percent
                          contentColor = Color.Red,
                          color = Color.White,
                          elevation = Dp(4f)
                      )
                  )
              }
          )
      }
  
  }
  
  @Composable
  fun showAlertDialog() {
      val openDialog = +state { true }
      if (openDialog.value) {
          AlertDialog(
              onCloseRequest = {
              },
              title = {
                  Text(text = "Logout")
              },
              text = {
                  Text("Are you sure you have to logout?")
              },
              confirmButton = {
                  Button("Yes", onClick = {
                      openDialog.value = false
                  })
              },
              dismissButton = {
                  Button("No", onClick = {
                      openDialog.value = false
                  })
              },
              buttonLayout = AlertDialogButtonLayout.Stacked
          )
      }
  
  }
  </code></pre>
  
  <p>Not able to figure out why it is crashing and what's the solution for this,
  any help will be appreciated.</p>
  
  <p>Thank you.</p>