@@ -92,16 +92,21 @@ This will allow ReactPy to handle the transition between routes more quickly by
9292the cost of a full page load.
9393
9494``` python
95- from reactpy import component, html, run
96- from reactpy_router import link, route, simple, use_location
95+ from reactpy import component, html, run, use_location
96+ from reactpy_router import link, route, simple
9797
9898@component
9999def root ():
100- location = use_location()
100+ use_location()
101101 return simple.router(
102- route(" /" , html.h1(" Home Page 🏠" )),
102+ route(
103+ " /" ,
104+ html.div(
105+ html.h1(" Home Page 🏠" ),
106+ link(html.button(" About" ), to = " /about" ),
107+ ),
108+ ),
103109 route(" /about" , html.h1(" About Page 📖" )),
104- link(" /about" , html.button(" About" )),
105110 )
106111```
107112
@@ -127,10 +132,16 @@ from reactpy_router import link, route, simple, use_query
127132
128133@component
129134def root ():
135+ use_location()
130136 return simple.router(
131- route(" /" , html.h1(" Home Page 🏠" )),
132- route(" /search" , search()),
133- link(" Search" , to = " /search?q=reactpy" ),
137+ route(
138+ " /" ,
139+ html.div(
140+ html.h1(" Home Page 🏠" ),
141+ link(" Search" , to = " /search?q=reactpy" ),
142+ ),
143+ ),
144+ route(" /about" , html.h1(" About Page 📖" )),
134145 )
135146
136147@component
@@ -152,9 +163,14 @@ from reactpy_router import link, route, simple, use_params
152163@component
153164def root ():
154165 return simple.router(
155- route(" /" , html.h1(" Home Page 🏠" )),
166+ route(
167+ " /" ,
168+ html.div(
169+ html.h1(" Home Page 🏠" ),
170+ link(" User 123" , to = " /user/123" ),
171+ ),
172+ ),
156173 route(" /user/{id: int} " , user()),
157- link(" User 123" , to = " /user/123" ),
158174 )
159175
160176@component
0 commit comments