Fix image related link prop warning with react 18 beta (#31895)
## Bug
Fixes #31892
react 18: requires camelcase for those props
```
Warning: Invalid DOM property `imagesrcset`. Did you mean `imageSrcSet`
```
react 17: requires lowercase for those props
```
Warning: React does not recognize the `imageSrcSet` prop on a DOM element.
```
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
### Utils
* Add command `yarn next-react-18 test/integration/any-react-18-app/`
* Add util `withReact18`
```js
const withReact18 = require('../../react-18/test/with-react-18')
module.exports = withReact18({
experimental: {
concurrentFeatures: true,
},
})
```
Showing
| ... | @@ -36,6 +36,7 @@ | ... | @@ -36,6 +36,7 @@ |
| "lint-staged": "lint-staged", | "lint-staged": "lint-staged", | ||
| "next-with-deps": "./scripts/next-with-deps.sh", | "next-with-deps": "./scripts/next-with-deps.sh", | ||
| "next": "node --trace-deprecation --enable-source-maps packages/next/dist/bin/next", | "next": "node --trace-deprecation --enable-source-maps packages/next/dist/bin/next", | ||
| "next-react-18": "node --trace-deprecation --enable-source-maps -r ./test/integration/react-18/test/require-hook.js packages/next/dist/bin/next", | |||
| "next-no-sourcemaps": "node --trace-deprecation packages/next/dist/bin/next", | "next-no-sourcemaps": "node --trace-deprecation packages/next/dist/bin/next", | ||
| "clean-trace-jaeger": "rm -rf test/integration/basic/.next && TRACE_TARGET=JAEGER node --trace-deprecation --enable-source-maps packages/next/dist/bin/next build test/integration/basic", | "clean-trace-jaeger": "rm -rf test/integration/basic/.next && TRACE_TARGET=JAEGER node --trace-deprecation --enable-source-maps packages/next/dist/bin/next build test/integration/basic", | ||
| "debug": "node --inspect packages/next/dist/bin/next", | "debug": "node --inspect packages/next/dist/bin/next", | ||
| ... | @@ -138,9 +139,9 @@ | ... | @@ -138,9 +139,9 @@ |
| "pretty-ms": "7.0.0", | "pretty-ms": "7.0.0", | ||
| "random-seed": "0.3.0", | "random-seed": "0.3.0", | ||
| "react": "17.0.2", | "react": "17.0.2", | ||
| "react-18": "npm:react@18.0.0-alpha-13455d26d-20211104", | "react-18": "npm:react@18.0.0-beta-0cc724c77-20211125", | ||
| "react-dom": "17.0.2", | "react-dom": "17.0.2", | ||
| "react-dom-18": "npm:react-dom@18.0.0-alpha-13455d26d-20211104", | "react-dom-18": "npm:react-dom@18.0.0-beta-0cc724c77-20211125", | ||
| "react-ssr-prepass": "1.0.8", | "react-ssr-prepass": "1.0.8", | ||
| "release": "6.3.0", | "release": "6.3.0", | ||
| "request-promise-core": "1.1.2", | "request-promise-core": "1.1.2", | ||
| ... | ... |
Please
register
or
sign in
to comment