Use this trick to send values from ui to server in module.
var_to_server(id, values)
The input variable to read value from.
The values need to be sent.
The hidden selectInput
object.
if (FALSE) {
widgetUI <- function(id) {
ns <- NS(id)
items <- c("chicken", "egg")
var_to_server(ns("items"), items)
}
widgetServer <- function() {
moduleServer(
id,
function(input, output, session) {
# items now can be read in the server
purrr::map_chr(isolate(input$items), print)
}
)
}
}