Goal
The behavior of this app should be equivalent whether the selectInput() is wrapped in ReactContext() or not:
shinyApp(
ui = shiny.react:::ReactContext(
selectInput("select", "Select", c("Apples", "Bananas"))
),
server = function(input, output) {}
)
Right now it gives the following error:
Error in FUN(X[[i]], ...) :
Expected a recursive structure built of NULLs, lists and dependencies
Root cause
Let's take a look at deparse(selectInput("select", "Select", c("Apples", "Bananas"))):
structure(
list(
# Omitted for brevity.
),
class = "shiny.tag",
html_dependencies = list(
structure(
function() {
if (is_shiny_app()) {
shiny::registerThemeDependency(func)
return(mfunc(get_current_theme()))
}
mfunc(bs_global_get())
},
class = "shiny.tag.function" # The problem
)
)
)
The problem boils down to this: the flattenDeps() function doesn't handle arguments of class shiny.tag.function.
Goal
The behavior of this app should be equivalent whether the
selectInput()is wrapped inReactContext()or not:Right now it gives the following error:
Root cause
Let's take a look at
deparse(selectInput("select", "Select", c("Apples", "Bananas"))):The problem boils down to this: the
flattenDeps()function doesn't handle arguments of classshiny.tag.function.