title: Don't display conditionalPanel when condition is wrong
body: <p>I try to create some shinyapp. I need to update sidebarPanel depends on condition received in server.R. The current code is shown below.<br>
  <strong>ui.R</strong></p>
  <pre><code>library(shiny)
  
  main_mat &lt;- matrix(data = c(1, 11, 3, 13,
                              12, 4, 8, 2,
                              3, 5, 14, 6),
                     nrow = 3, ncol = 4, byrow = T)
  colnames(main_mat) &lt;- c(&quot;B1&quot;, &quot;B2&quot;, &quot;B3&quot;, &quot;B4&quot;)
  rownames(main_mat) &lt;- c(&quot;A1&quot;, &quot;A2&quot;, &quot;A3&quot;)
  ai &lt;- c(140, 160, 100)
  bj &lt;- c(80, 40, 150, 130, NA)
  res1 &lt;- ai
  res2 &lt;- bj
  m &lt;- cbind(main_mat, ai)
  m &lt;- rbind(m, bj)
  
  shinyUI(fluidPage(
    
    titlePanel(&quot;Header&quot;),
    
    
    sidebarPanel(
      width = 6,
      tags$h4(&quot;Table&quot;),
      matrixInput(
        &quot;sample&quot;,
        value = m,
        rows = list(
          names = TRUE
        ),
        cols = list(
          names = TRUE
        ),
        copy = TRUE,
        paste = TRUE
      )
    ),
    sidebarPanel(
      conditionalPanel(condition = &quot;output.cond() == 'dontwork'&quot;, textOutput(&quot;text&quot;)),
      conditionalPanel(condition = &quot;output.cond() == 'work'&quot;, tableOutput(&quot;obs&quot;))
        
      )
    )
  )
  
  </code></pre>
  <p><strong>server.R</strong></p>
  <pre><code>library(shiny)
  library(shinyMatrix)
  
  server &lt;- function(input, output, session) {
    main_func &lt;- function(df) {return(t(df))} 
    observe({
      if (sum(as.numeric(input$sample[4,1:4]), na.rm = T) == sum(as.numeric(input$sample[1:3,5]), na.rm = T)) {
        output$cond &lt;- reactive('work')
      } else {
        output$cond &lt;- reactive('dontwork')
      }
    })
    output$obs &lt;- renderTable({main_func(input$sample)})
    
    
    observe(if (sum(as.numeric(input$sample[4,1:4]), na.rm = T) == sum(as.numeric(input$sample[1:3,5]), na.rm = T)) {
      output$text &lt;- renderText(&quot;cond1&quot;)
    } else {
      output$text &lt;- renderText(&quot;cond2&quot;)
    })
  }
  </code></pre>
  <p>I expect that when the condition is true then only <code>output$obs</code> is displayed, and when the condition is not true, the <code>output$obs</code> is not displayed and only the <code>output$text</code> is displayed. But in fact, when i change values input values, <code>output$text</code> changes, but <code>tableOutput(&quot;obs&quot;)</code> still displaying. How can I hide the <code>tableOutput(&quot;obs&quot;)</code> if the condition is incorrect?</p>