title: How to initialize a variable in Kotlin with an Interfaced type?
body: <p>I'm brand new to Kotlin. I wanted to try the create-react-kotlin-app since I'm a react developer currently and I want to explore Kotlin.</p>
  
  <p>I'm having a tough time instaniating my variables. I'm trying to do this: </p>
  
  <pre><code>fun main(args: Array&lt;String&gt;) {
      val rootDiv = document.getElementById("root")
      val gm : GameUiProps
      gm.numPlayers = 2
      gm.cardArray = arrayOf("Card to be dealt", "Cards to be Dealt")
      gm.playerArray = arrayOf("Player 1", "Player 2")
  
      RBuilder.render(rootDiv) {
          GameUi(gm)
      }
  }
  </code></pre>
  
  <p>My <code>gm</code> variable isn't being initialized and I can't figure how how to do it.  </p>
  
  <p>I need to initiazle my GameUi component with props, but I can't figure out how to do that.</p>
  
  <p>So GameUiProps comes from my component</p>
  
  <pre><code>interface GameUiProps : RProps {
      var numPlayers: Int
      var playerArray: Array&lt;String&gt;
      var cardArray: Array&lt;String&gt;
  }
  
  class GameUi(props: GameUiProps) : RComponent&lt;GameUiProps, RState&gt;(props) {
  
      private fun RBuilder.createHands() {
          var numPlayers = props.numPlayers
          val handArray: ArrayList&lt;Unit&gt; = ArrayList()
          while (numPlayers &gt; 0) {
              handArray.add(
                      handUi(
                              props.playerArray[numPlayers],
                              props.cardArray[numPlayers]
                      )
              )
              numPlayers--
          }
      }
  
      override fun RBuilder.render() {
          div {
              h1("sweet") {
                  +"RKT"
              }
              div {
                  createHands()
              }
          }
      }
  }
  </code></pre>