Q:

Creating a tab after an action button has been triggered in shiny

I'm trying to generate a tab panel after a user has pressed an action button in a Rmarkdown document that's using Shiny.
Here's a minimal viable example of what I have so far (not producing the desired results):

---
title: "Test Doc"
output: html_document
runtime: shiny
---

```{r, echo = FALSE, results="hide", message=FALSE, warning=FALSE}
library(shiny)
library(rmarkdown)
```

```{r, echo = FALSE, cache=FALSE}
sidebarPanel(
  actionButton("testButton", label="Test!",
                            icon=icon("search"))
)
```

```{r, echo = FALSE, cache=FALSE}
tab_test_1<-eventReactive(input$testButton, {
  output$tab_test<-renderUI({
    tabsetPanel(tabPanel("Plot"))
  })
})
uiOutput("tab_test")
```

A:

Try with 
```{r, echo = FALSE, cache=FALSE}
output$tab_test<-renderUI({
    req(input$testButton);
    tabsetPanel(tabPanel("Plot"))
  })
uiOutput("tab_test")
```

