Skip to content

Commit 590aae9

Browse files
committed
Add warning when using old reactMode
1 parent 83acf34 commit 590aae9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/next/next-server/server/config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ function assignDefaults(userConfig: { [key: string]: any }) {
3535
delete userConfig.exportTrailingSlash
3636
}
3737

38+
if (typeof userConfig.experimental?.reactMode !== 'undefined') {
39+
console.warn(
40+
chalk.yellow.bold('Warning: ') +
41+
'The experimental "reactMode" option has been replaced with "reactRoot". Please update your next.config.js.'
42+
)
43+
if (typeof userConfig.experimental?.reactRoot === 'undefined') {
44+
userConfig.experimental.reactRoot = ['concurrent', 'blocking'].includes(
45+
userConfig.experimental.reactMode
46+
)
47+
}
48+
delete userConfig.experimental.reactMode
49+
}
50+
3851
const config = Object.keys(userConfig).reduce<{ [key: string]: any }>(
3952
(currentConfig, key) => {
4053
const value = userConfig[key]

0 commit comments

Comments
 (0)