tests/testthat/test-apps/Link/App.R

library(shiny)

ui <- reactRouter::HashRouter(
  reactRouter::Link(to = "/about", id = "linkAbout", "Go to About"),
  reactRouter::Routes(
    reactRouter::Route(
      path = "/",
      element = div(id = "homePage", tags$p("home"))
    ),
    reactRouter::Route(
      path = "about",
      element = div(id = "aboutPage", tags$p("about content"))
    )
  )
)

server <- function(input, output, session) {}

shinyApp(ui, server)

Try the reactRouter package in your browser

Any scripts or data that you put into this service are public.

reactRouter documentation built on May 10, 2026, 5:07 p.m.