'NEXT JS - App is rendered twice with rewrites
I'm developing a NEXT JS project and can't find a solution for a twice rendering app!
Problem
After adding rewrites to next.config.js, App is rendered twice. If remove, rendred once.
next.config.js
async rewrites() {
return [
{
source: '/about',
destination: '/',
},
]
},
_app.js
function MyApp() {
console.log('App render');
return (<></>);
}
export default MyApp
Solution 1:[1]
this should be expected behavior-- as rewrites cause double renders in nextjs
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | rbtmr |


