Skip to content

Commit 26117c0

Browse files
authored
Merge pull request #1 from Yoast/remove-or-neutralize-react-19-prop-types
Remove or neutralize react 19 prop types
2 parents 6a4d3a4 + 87699db commit 26117c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

default.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,14 @@ export const reactConfig = [
241241
"react/no-unused-prop-types": "error",
242242
"react/no-unused-state": "error",
243243
"react/prefer-es6-class": "error",
244-
"react/require-default-props": [ "error", { ignoreFunctionalComponents: true } ],
244+
// This will turn into an `error` in the future. It's a warning to give us time to adapt.
245+
"react/require-default-props": [ "warn", { classes: "defaultProps", functions: "defaultArguments" } ],
245246
"react/self-closing-comp": "error",
246247
"react/void-dom-elements-no-children": "error",
248+
249+
// Removed in React 19 (https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops).
250+
// But still in the recommended rules (https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.37.5/docs/rules/prop-types.md).
251+
"react/prop-types": "off",
247252
},
248253
},
249254
];

0 commit comments

Comments
 (0)