File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
examples/rsp-next-ts/pages Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,18 @@ import Moon from "@spectrum-icons/workflow/Moon";
14
14
import Light from "@spectrum-icons/workflow/Light" ;
15
15
import { ToastContainer } from "@react-spectrum/toast" ;
16
16
import { enableTableNestedRows } from '@react-stately/flags' ;
17
+ import { useRouter } from 'next/router' ;
17
18
18
19
function MyApp ( { Component, pageProps } : AppProps ) {
19
20
const [ theme , setTheme ] = useState < ColorScheme > ( "light" ) ;
20
21
22
+ let router = useRouter ( ) ;
21
23
let themeIcons = { dark : < Moon /> , light : < Light /> } ;
22
24
let otherTheme : ColorScheme = theme === "light" ? "dark" : "light" ;
23
25
enableTableNestedRows ( ) ;
24
26
25
27
return (
26
- < Provider theme = { lightTheme } colorScheme = { theme } >
28
+ < Provider theme = { lightTheme } colorScheme = { theme } router = { { navigate : router . push } } >
27
29
< Grid
28
30
areas = { [ "header" , "content" ] }
29
31
columns = { [ "1fr" ] }
Original file line number Diff line number Diff line change
1
+ export default function Foo ( ) {
2
+ return < h1 > Foo</ h1 > ;
3
+ }
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ export default function Home() {
167
167
< MenuTrigger >
168
168
< ActionButton > Menu Trigger</ ActionButton >
169
169
< Menu >
170
+ < Item href = "/foo" > Link to /foo</ Item >
170
171
< Item > Cut</ Item >
171
172
< Item > Copy</ Item >
172
173
< Item > Paste</ Item >
@@ -268,15 +269,13 @@ export default function Home() {
268
269
< Item key = "march 2020 assets" > March 2020 Assets</ Item >
269
270
</ Breadcrumbs >
270
271
271
- < Link >
272
- < a
273
- href = "https://www.imdb.com/title/tt6348138/"
274
- target = "_blank"
275
- rel = "noreferrer"
276
- >
277
- The missing link.
278
- </ a >
272
+ < Link
273
+ href = "https://www.imdb.com/title/tt6348138/"
274
+ target = "_blank"
275
+ rel = "noreferrer" >
276
+ The missing link.
279
277
</ Link >
278
+ < Link href = "/foo" > Foo</ Link >
280
279
281
280
< Tabs aria-label = "History of Ancient Rome" >
282
281
< TabList >
You can’t perform that action at this time.
0 commit comments