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

library(shiny)

ui <- reactRouter::MemoryRouter(
  initialEntries = list("/about"),
  reactRouter::Routes(
    reactRouter::Route(
      path = "/",
      element = div(id = "memHome", tags$p("memory home"))
    ),
    reactRouter::Route(
      path = "about",
      element = div(id = "memAbout", tags$p("memory about"))
    )
  )
)

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.