File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
packages/@headlessui-react/pages Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function KeyCaster() {
105
105
106
106
function MyApp ( { Component, pageProps } ) {
107
107
const router = useRouter ( )
108
- const { allExamples = [ ] } = pageProps
108
+ const { examples = [ ] } = pageProps
109
109
110
110
return (
111
111
< >
@@ -138,7 +138,7 @@ function MyApp({ Component, pageProps }) {
138
138
alt = "Tailwind UI"
139
139
/>
140
140
</ NextLink >
141
- { allExamples . length > 0 && (
141
+ { examples . length > 0 && (
142
142
< div >
143
143
< select
144
144
value = { router . asPath }
@@ -147,7 +147,7 @@ function MyApp({ Component, pageProps }) {
147
147
} }
148
148
className = "block w-full py-2 pl-3 pr-10 text-base leading-6 border-gray-300 form-select focus:outline-none focus:shadow-outline-blue focus:border-blue-300 sm:text-sm sm:leading-5"
149
149
>
150
- < RecursiveExamplesSelectOptions examples = { allExamples } />
150
+ < RecursiveExamplesSelectOptions examples = { examples } />
151
151
</ select >
152
152
</ div >
153
153
) }
Original file line number Diff line number Diff line change 1
1
import * as React from 'react'
2
- import { NextApiRequest } from 'next'
3
2
import Error from 'next/error'
4
3
import Head from 'next/head'
5
4
import Link from 'next/link'
@@ -16,11 +15,10 @@ function NextLink(props: PropsOf<'a'>) {
16
15
)
17
16
}
18
17
19
- export async function getServerSideProps ( { req } : { req : NextApiRequest } ) {
18
+ export async function getStaticProps ( ) {
20
19
return {
21
20
props : {
22
- allExamples : await resolveAllExamples ( 'pages' ) ,
23
- examples : await resolveAllExamples ( 'pages' , ...req . url . split ( '/' ) . slice ( 1 ) ) ,
21
+ examples : await resolveAllExamples ( 'pages' ) ,
24
22
} ,
25
23
}
26
24
}
You can’t perform that action at this time.
0 commit comments