next-with-apollo
next-with-apollo copied to clipboard
Update `5.3.0` broke router usage in _app.js
Update 5.3.0 broke router usage.
I was using router like this in _app.js:
function MyApp({ Component, apollo, pageProps, router }) {
const { route } = router;
if (route === '/login') { }
Now router is undefined
i see, we destrucutre router out of props, now it does not get passed to render / Page
I have fixed it by just using:
import { useRouter } from 'next/router'
function MyApp({ Component, apollo, pageProps }) {
const { route } = useRouter();
if (route === '/login') { }
(...)
Seems to work the same for now, but that's still a breaking change for some probably.
yes, pushed a pr to fix it! sorry for that