Skip to content
Discussion options

You must be logged in to vote

Thanks for asking! Currently shiny.react cannot handle "nested" components, so shiny.fluent doesn't include them. I created issue #87 to track this feature.

For now it is possible to use the following workaround:

library(shiny.fluent)

CustomComponents <- tags$script(HTML("(function() {
  const CustomComponents = jsmodule['CustomComponents'] = {};
  const { Stack } = jsmodule['@fluentui/react'];
  CustomComponents.StackItem = Stack.Item;
})();"))

Stack.Item <- function(...) shiny.react::reactElement(
  module = "CustomComponents",
  name = "StackItem",
  props = shiny.react::asProps(...),
  deps = shiny.fluent::shinyFluentDependency()
)

shinyApp(
  ui = tagList(
    CustomComponents,
  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zilch42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants