I have an issue with using modules with bs4Dash. I have created a ShinyApp with modules using golem which I created from my previous ShinyApp.
I have no issue in using input$dark_mode == TRUE
or if (input$dark_mode)
if it is a single app, for example,
if (input$dark_mode)
{
p1 <- plotly::ggplotly(plot01 + ggplot_dark_theme)
p1
}
else {
p1 <- plotly::ggplotly(plot01 + ggplot_light_theme)
p1
}
But when you use module it returns Error: argument is of length zero
Has anyone seen error like this? Is there a fix? Thanks.
Update:
I have fixed this by using
reactiveValues()
andobserve()
functions inapp_server.R
And linking
global
to the plot modules.