title: How to pop back stack when button is pressed on Jetpack Compose
body: <p>I have a compose screen in a fragment, and in that screen there is a button.</p>
  <p>I want to dismiss the fragment/go back to previous screen when this button is pressed.</p>
  <p>But I can't access any activity/fragment methods inside onClick.</p>
  <p>How can I do that?</p>
  <pre><code>@AndroidEntryPoint
  class MyFragment @Inject constructor() : Fragment(){
  
      @ExperimentalComposeUiApi
      override fun onCreateView(
          inflater: LayoutInflater,
          container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View {
          return ComposeView(requireContext()).apply {
              this.setContent {
                  Button(
                      onClick = {
                          //Dismiss fragment.
                      },
                  ) {
                      Text(
                          &quot;Click me&quot;
                      )
                  }
              }
          }
      }
  }
  </code></pre>