Hi, I am really struggling with getting basic reactivity working within a Shiny module. Below, I've copied the module that I'm using. When I run this, the output shows for the initial value of the input, but doesn't update when I change the input. I'm hoping this is a really easy fix because it's such a simple thing I'm trying to do.
I've read the documentation for Shiny modules as well as about 30 Q&As on stack overflow and this site. Nothing has worked so far. Any help would be hugely appreciated!
mod_user_feedback_ui <- function(id) {
ns <- NS(id)
tagList(
numericInput(
inputId = ns('n'),
label = 'Select an even number',
value = 1
),
shiny::textOutput(ns('half'))
)
}
mod_user_feedback_server <- function(id) {
moduleServer(id, function(input, output, session) {
ns <- session$ns
half <- reactive({
paste0('Half:', input$n / 2)
})
output$half <- shiny::renderText(half())
})
}