Getting rid of the renderUI
Convert our properties to a
JSON
withtoJSON()
.Embed the
JSON
in a script tag withdata-for
attribute pointing to the uniqueid
parameter.
box2 <- function(..., id = NULL, title = NULL, footer = NULL,
background = NULL, width = 6, height = NULL,
collapsible = FALSE, collapsed = FALSE) {
# ....; Extra code removed
configTag <- tags$script(
type = "application/json",
`data-for` = id,
jsonlite::toJSON(
x = props,
auto_unbox = TRUE,
json_verbatim = TRUE
)
)
}