The error message shinyjs: extendShinyjs: \functions` argument must be provided. See the documentation for `?extendShinyjs` for more details.indicates that you are missing thefunctionsargument in your call to theextendShinyjs` function.
In your code, you are using the shinyjs package to unbind the shiny.postRender and shiny.postRenderQuietly events. To do this, you need to use the extendShinyjs function to define a new JavaScript function that will unbind these events.
Here is the updated code with the functions argument added:
library(shiny)
library(shinydashboard)
library(shinyjs)
ui <- shinydashboard::dashboardPage(
shinydashboard::dashboardHeader(disable = TRUE),
shinydashboard::dashboardSidebar(
tags$style(HTML(".main-sidebar {padding-top: 0px !important;}")),
sidebarMenu(
menuItem("Home", tabName = "home", icon = icon("house"))
)
),
shinydashboard::dashboardBody(
shinydashboard::tabBox(
title = "title",
shiny::tabPanel(
"test panel"
)
)
),
tags$script("Shiny.unbindAll(Shiny.events$appLifecycle('shiny.postRender')), Shiny.unbindAll(Shiny.events$appLifecycle('shiny.postRenderQuietly'))")
)
server <- function(input, output, session) {
extendShinyjs(text = "unbindAll", functions = c("unbindAll"))
}
shiny::shinyApp(ui, server)
In this updated code, we have added the following line to the server section:
extendShinyjs(text = "unbindAll", functions = c("unbindAll"))
This line of code defines a new JavaScript function called unbindAll that will unbind the shiny.postRender and shiny.postRenderQuietly events. We then use this function in the tags$script statement to unbind these events.
With this change, the error message should go away and the footer should be removed from your Shiny app.