title: How can I use the state on an external function?
body: <p>Can someone explain me how to use the state on the external function?</p>
  <p>All I get is:</p>
  <blockquote>
  <p>Unresolved reference: selectedTab on the composable function contentTabs</p>
  </blockquote>
  <pre><code>var selectedTab by remember { mutableStateOf(Tabs.TabContent) }
  //...
  TabRow(selectedTabIndex = selectedTab.ordinal)
  {
      Tab(
          selectedContentColor = MaterialTheme.colors.onSurface,
          unselectedContentColor = MaterialTheme.colors.onSurface.copy(alpha = ContentAlpha.medium),
          selected = selectedTab.ordinal == Tabs.TabContent.ordinal,
          onClick = { selectedTab = Tabs.TabContent}
      ) {
          Column(
              modifier = Modifier.padding(8.dp),
              horizontalAlignment = Alignment.CenterHorizontally
          ) {
              Text(
                  text = Tabs.TabContent.title,
              )
          }
      }
      // More Tabs 
      Tab()
      Tab()
  }
  </code></pre>
  <p>Here is my enum class:</p>
  <pre><code>enum class Tabs(
      val title: String
  ) {
      ContentTabPosts(&quot;People&quot;), TabCommunity(&quot;Friends&quot;)
  }
  </code></pre>
  <p>Here is my external function:</p>
  <pre><code>@Composable
  fun contentTabs(inputTab : Tabs){
      Tab(
          selected = selectedTab.ordinal == Tabs.inputTab.ordinal,
          onClick = { selectedTab = Tabs.inputTab }
      ) {
          Column(
              modifier = Modifier.padding(8.dp),
          ) {
              Spacer(modifier = Modifier.height(4.dp))
              Text(
                  text = Tabs.inputTab.title,
              )
          }
      }
  }
  </code></pre>