I am trying to print the selected value from the dropdown which can be achieved with simple code below:
library(shiny)
ui <- fluidPage(
tagList(
selectInput(
inputId = "test",
label = "Test",
choices = c("Test1", "Test2", "Test3"),
selected = NULL),
uiOutput("text")
)
)
server <- function(input, output, session) {
output$text <- renderText({
req(input$test)
input$test
})
}
shinyApp(ui, server)
But I am trying to do the same behavior but using the insertUI and removeUI functions from shiny. Like it will remove the previous selected value and will insert the new value.
Is there any way that this can be done?