tatethurston / nextjs-routes

Type safe routing for Next.js
MIT License
553 stars 20 forks source link

Fix import nextjs type #144

Closed po4tion closed 1 year ago

po4tion commented 1 year ago

[ BEFORE ]

import type {
    GetServerSidePropsContext as NextGetServerSidePropsContext,
    GetServerSidePropsResult as NextGetServerSidePropsResult
} from "nextjs";

[ AFTER ]

import type {
    GetServerSidePropsContext as NextGetServerSidePropsContext,
    GetServerSidePropsResult as NextGetServerSidePropsResult
} from "next";

For the "BEFORE" type, it has any type(GetServerSidePropsContext, GetServerSidePropsResult), so no child type such as previewData was inferred from the "NextGetServerSidePropsContext["previewData"] type.

Please advise if this is your intention.

tatethurston commented 1 year ago

This was a silly bug 🤦 Thanks for the fix!