Commit 5f4e606e authored by JJ Kasper's avatar JJ Kasper Committed by Joe Haddad

Fix using withRouter in _app opting out of auto-export (#8811)

parent b4946ae2
......@@ -38,6 +38,8 @@ export default function withRouter<
}
WithRouteWrapper.getInitialProps = ComposedComponent.getInitialProps
// This is needed to allow checking for custom getInitialProps in _app
;(WithRouteWrapper as any).origGetInitialProps = (ComposedComponent as any).origGetInitialProps
if (process.env.NODE_ENV !== 'production') {
const name =
ComposedComponent.displayName || ComposedComponent.name || 'Unknown'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment