As this link says about Action Button, the input$action return the number of clicks
On the button.

CodePudding user response:
If we really need to "reset" the button, we can re-render it. Here is an example app:
library(shiny)
library(dplyr)
ui <- fluidPage(
uiOutput("action"),
actionButton("reset", "Reset"),
verbatimTextOutput("values")
)
server <- function(input, output, session) {
output$action <- renderUI({
actionButton("action_but", "Action")
})
vals <- reactiveVal(tibble(clicks = integer(0)))
counter <- reactiveVal(0)
observe({
counter(input$action_but)
})
observeEvent(input$reset,
{
vals(add_row(vals(), clicks = as.integer(input$action_but)))
output$action <- renderUI({
actionButton("action_but", "Action")
})
counter(input$action_but)
},
ignoreInit = TRUE
)
output$values <- renderPrint({
list(counter(), vals())
})
}
shinyApp(ui, server)

