fix(pages): avoid types errors
This commit is contained in:
parent
d46be16a11
commit
6beb23cf58
@ -2,7 +2,7 @@ import type { AppProps } from 'next/app'
|
|||||||
|
|
||||||
import '../styles/main.scss'
|
import '../styles/main.scss'
|
||||||
|
|
||||||
const MyApp = ({ Component, pageProps }: AppProps) => {
|
const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
|
||||||
return <Component {...pageProps} />
|
return <Component {...pageProps} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||||
|
|
||||||
type Data = {
|
interface Data {
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function handler(
|
const handler = (req: NextApiRequest, res: NextApiResponse<Data>): void => {
|
||||||
req: NextApiRequest,
|
|
||||||
res: NextApiResponse<Data>
|
|
||||||
) {
|
|
||||||
res.status(200).json({ name: 'John Doe' })
|
res.status(200).json({ name: 'John Doe' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default handler
|
||||||
|
Loading…
Reference in New Issue
Block a user