Skip to content

Parallel Routes ( @...x.py & use_parallel() function )

Sarthak Ghoshal edited this page May 30, 2025 · 1 revision

Parallel Routes ( +@...x.py & use_parallel() function )

use these routes to use inside of other routes

+@....x.py

the route that you want to export to other routes

same syntax as Regular Files, the difference being the naming system, you add the "+@" onto the front of the files name to tell the router that the .x.py is a Parallel Route

use_parallel(file_name)

this function import the Parallel route file with the same name as file_name

# main.x.py

from reactpy import component, HTML
from lilliepy_dir_router import use_parallel

@component
def main():
    return html._(
        html.h1("Main Page"),
        use_parallel("side_bar")
    )

Clone this wiki locally