rsnext/test/lib/with-react-17.js
JJ Kasper 4a7ab34baf
Update repo to use react 18 by default (#35888)
This updates our `yarn next` command to leverage react v18 by default and removes the need for the test require hook/config modifying when testing react 18. There are some fixtures we need to investigate react 18 support in follow-ups:

- `test/integration/client-navigation-a11y`
- `test/integration/critical-css`
- `test/integration/custom-error-page-exception`
- `test/integration/font-optimization`
- AMP specific tests
2022-04-05 21:51:47 +00:00

14 lines
450 B
JavaScript

module.exports = function withReact17(config) {
config.webpack = (webpackConfig) => {
const { alias } = webpackConfig.resolve
// Use react 18
alias['react'] = 'react-17'
alias['react-dom'] = 'react-dom-17'
alias['react-dom/client'] = 'react-dom-17/client'
alias['react-dom/server'] = 'react-dom-17/server'
alias['react-dom/server.browser'] = 'react-dom-17/server.browser'
return webpackConfig
}
return config
}