@@ -11,7 +11,8 @@ import PropTypes from 'prop-types';
1111import acceptLanguage from 'accept-language' ;
1212import { create } from 'jss' ;
1313import rtl from 'jss-rtl' ;
14- import { Router as Router2 , useRouter } from 'next/router' ;
14+ import { useRouter } from 'next/router' ;
15+ import { rewriteUrlForNextExport } from 'next/dist/next-server/lib/router/rewrite-url-for-export' ;
1516import { StylesProvider , jssPreset } from '@material-ui/styles' ;
1617import pages from 'docs/src/pages' ;
1718import initRedux from 'docs/src/modules/redux/initRedux' ;
@@ -58,7 +59,7 @@ function LanguageNegotiation() {
5859
5960 React . useEffect ( ( ) => {
6061 const { userLanguage : userLanguageUrl , canonical } = pathnameToLanguage (
61- Router2 . _rewriteUrlForNextExport ( router . asPath ) ,
62+ rewriteUrlForNextExport ( router . asPath ) ,
6263 ) ;
6364 const preferedLanguage =
6465 getCookie ( 'userLanguage' ) !== 'noDefault' && userLanguage === 'en'
@@ -289,7 +290,7 @@ function AppWrapper(props) {
289290 if ( pathname !== '/' ) {
290291 // The leading / is only added to support static hosting (resolve /index.html).
291292 // We remove it to normalize the pathname.
292- // See `_rewriteUrlForNextExport ` on Next.js side.
293+ // See `rewriteUrlForNextExport ` on Next.js side.
293294 pathname = pathname . replace ( / \/ $ / , '' ) ;
294295 }
295296 const activePage = findActivePage ( pages , pathname ) ;
0 commit comments