ElianHugh / rsx

Encapsulated Shiny modules
https://elianhugh.github.io/rsx/
GNU General Public License v3.0
2 stars 0 forks source link

Throw an error with passed slots that are not top-level #8

Open ElianHugh opened 1 year ago

ElianHugh commented 1 year ago

Passing non-top level slots to components doesn't really make sense, and should probably through an error.

E.g.

x <- component(
    template = function(ns) {
        shiny::tagList(
            shiny::tags$slot(),
            shiny::tags$slot(name = "a")
        )
    }
)

# the following would resolve to both slot 1 and slot 2
x(
    shiny::div(
        shiny::p(slot = "a")
   )
)