title: Kotlin Desktop Compose Does Not Refresh Main View
body: <p>Every time I click on a tile in my board it should refresh the <code>MainView()</code> so a red border can be on the tile, but it doesn't refresh the view. Is there any way to update the view every time the <code>board</code> changes?</p>
  <p>Application Start:</p>
  <pre><code>var board: Board = Board()
  
  fun main() = application {
      board = Board()
  
      Window(onCloseRequest = ::exitApplication, title = &quot;Castle Run&quot; ) {
          WindowContent(::exitApplication)
      }
  }
  </code></pre>
  <p>UI:</p>
  <pre><code>@Composable
  fun FrameWindowScope.WindowContent(onExit: () -&gt; Unit) {
      MaterialTheme {
          MainView() { tile -&gt; click(tile) }
      }
  }
  
  fun click(tile: Tile){
      board.selectTile(tile)
      println(board.selectedTile)
  }
  
  @Composable
  fun MainView(onClick: (Tile) -&gt; Unit) {
      paintBoard(onClick)
  }
  
  @Composable
  fun paintBoard(onClick: (Tile) -&gt; Unit) {
      for (r in 0 until board.rows + 2) {
          for (c in 0 until board.columns + 2) {
              paintTile(board.boardArray[r][c], board.getPieceAt(r, c), onClick)
          }
      }
  }
  </code></pre>