TypeScript NextPageContext augmentation
See original GitHub issueHi everyone,
I am wondering if there is a reason why next-redux-wrapper declares its own NextJSPageContext
and NextJSAppContext
instead of merging the context props store
and isServer
into the NextPageContext
interface?
Background: I am having problems setting up my _app component with TypeScript because the App
class from “next/app” can only be extended when getInitialProps takes an AppContext
as its parameter.
Augmenting NextPageContext
would be a nice solution in my opinion. Also, store
and isServer
would be available on every NextPage
’s getInitialProps
context without any extra configuration.
If this approach is welcome I would be happy to create a PR! In this case, I would augment NextPageContext
and deprecate NextJSPageContext
and NextJSAppContext
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:11 (8 by maintainers)
Top GitHub Comments
https://github.com/kirill-konshin/next-redux-wrapper/pull/176 code is in master now, it will be released after I do some more testing. Hopefully this week.
Pull request is welcome.