Does anyone know why NextJS dev mode recreates class instances?
Answered
Chinese Alligator posted this in #help-forum
Original message was deleted.
Answered by not-milo.tsx
That's a little something React does when it's in strict mode. It renders all components twice to detect any potential issues with them and warn you. It's recommended that you keep it, but if you don't want to you can use
See: https://nextjs.org/docs/app/api-reference/next-config-js/reactStrictMode
next.config.js
to disable it.See: https://nextjs.org/docs/app/api-reference/next-config-js/reactStrictMode
3 Replies
That's a little something React does when it's in strict mode. It renders all components twice to detect any potential issues with them and warn you. It's recommended that you keep it, but if you don't want to you can use
See: https://nextjs.org/docs/app/api-reference/next-config-js/reactStrictMode
next.config.js
to disable it.See: https://nextjs.org/docs/app/api-reference/next-config-js/reactStrictMode
Answer
Chinese Alligator
Thanks man appreciate it!
Np ✌ðŸ»