title: Hide and clear selectInput
body: <p>I need to show\hide input and will be great get NULL or empty string if the input not exists, here reproducible example:</p>
  
  <pre><code>ui &lt;- 
    dashboardPage(
      dashboardHeader(
        title = 'Test'),
      dashboardSidebar(),
      dashboardBody(
        selectInput(
          inputId = 'mainInput',
          label = 'Main input',
          selected = 'Show',
          choices = c('Show', 'Hide')
        ),
        uiOutput(
          outputId = 'secondInputUI'
        ),
        actionButton(
          inputId = 'thirdInput',
          label = 'Check value'
        )
      )
  )
  server &lt;- function(input, output, session){
    observeEvent(input$mainInput, ignoreNULL = TRUE, {
      if (input$mainInput == 'Show')
        output$secondInputUI &lt;- 
          renderUI(
            selectInput(
              inputId = 'secondInput',
              label = 'Second input',
              selected = 0,
              multiple = FALSE,
              choices = c(1, 0)
            )
          )
      else {
        output$secondInputUI &lt;- 
          renderUI(
            selectInput(
              inputId = 'secondInput',
              label = 'Second input',
              selected = '',
              multiple = TRUE,
              choices = c(1, 0)
            )
          )
        # If uncommit - input value don't update and will return latest available before delete input
        # output$secondInputUI &lt;- 
        #   NULL
      }
    })
  
    observeEvent(input$thirdInput, {
      showNotification(
        session = session, 
        ui = paste(input$secondInput, collapse = ', '))
    })
  }
  
  shinyApp(
    ui = ui,
    server = server)
  </code></pre>
  
  <p>You can see commented part with setting NULL to uioutput, if it active - shiny return latest available value before clear that ui, so how to deal with that?</p>