dillon1000/react
Commit
Browse files Remove JSX propTypes validation (#28328)
This removes the remaining `propTypes` validation calls, making
declaring `propTypes` a no-op. In other words, React itself will no
longer validate the `propTypes` that you declare on your components.
In general, our recommendation is to use static type checking (e.g.
TypeScript). If you'd like to still run propTypes checks, you can do so
manually, same as you'd do outside React:
```js
import checkPropTypes from 'prop-types/checkPropTypes';
function Button(props) {
checkPropTypes(Button.propTypes, prop, 'prop', Button.name)
// ...
}
```
This could be automated as a Babel plugin if you want to keep these
checks implicit. (We will not be providing such a plugin, but someone in
community might be interested in building or maintaining one.)Changed paths10 files
First-parent comparisonpackages/react-art/npm/Circle.js ModifiedM packages/react-art/npm/Rectangle.js ModifiedM packages/react-art/npm/Wedge.js ModifiedM packages/react-art/src/__tests__/ReactART-test.js ModifiedM packages/react-dom/src/__tests__/ReactFunctionComponent-test.js ModifiedM packages/react/src/__tests__/ReactElementClone-test.js ModifiedM packages/react/src/__tests__/ReactElementValidator-test.internal.js ModifiedM packages/react/src/__tests__/ReactJSXElementValidator-test.js ModifiedM packages/react/src/jsx/ReactJSXElement.js ModifiedD packages/shared/checkPropTypes.js DeletedPatch
Files changed
Rendering syntax-highlighted changes…