Enabling Concurrent Mode in NextJS #10645
-
Via: #10643 I'd like to test out concurrent mode in my current nextjs project, now that its been released in experimental mode. The way to enable it in a normal react app is quite straght forward by switching The problem is nextjs does that part for each page under the hood. It would be nice to have a option in next.config.js to turn concurrent mode on, or even better a way to opt-in per page (e.g. if there are a few old legacy pages that will not work in react strict mode, those dont get opted in, but we can opt in the ones that are ready for this). |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
You can enable it as experimental under:
There is no way to do per-page opt-in as the React tree can't be rendered in two different modes (also the entrypoint is different). So to start you should enable strict mode and make all pages are compatible:
|
Beta Was this translation helpful? Give feedback.
-
I can't seem to enable concurrent mode without breaking all client-side React functionality. In my own app, when I set |
Beta Was this translation helpful? Give feedback.
-
I can't get this to work anymore with
Which doesn't make sense to me because in React 17, |
Beta Was this translation helpful? Give feedback.
-
I run my next project at concurrent mode but it is super slow now. That caused since it is still experiemental version or i need to configure something else ? Basically added these options to next.config.js :
dependencies here :
Now project is super jittery and slow |
Beta Was this translation helpful? Give feedback.
You can enable it as experimental under:
There is no way to do per-page opt-in as the React tree can't be rendered in two different modes (also the entrypoint is different).
So to start you should enable strict mode and make all pages are compatible: