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'
|
||||
|
||||
const MyApp = ({ Component, pageProps }: AppProps) => {
|
||||
const MyApp = ({ Component, pageProps }: AppProps): JSX.Element => {
|
||||
return <Component {...pageProps} />
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
type Data = {
|
||||
interface Data {
|
||||
name: string
|
||||
}
|
||||
|
||||
export default function handler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse<Data>
|
||||
) {
|
||||
const handler = (req: NextApiRequest, res: NextApiResponse<Data>): void => {
|
||||
res.status(200).json({ name: 'John Doe' })
|
||||
}
|
||||
|
||||
export default handler
|
||||
|
Loading…
Reference in New Issue
Block a user