react-native-view-prop-types
Replace View.propTypes with ViewPropTypes.
Usage
bash
Development
bash
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
Replace View.propTypes with ViewPropTypes
npx codemod @react-new/react-native-view-prop-types
Replace View.propTypes with ViewPropTypes.
bash
bash
This is one example from the codemod's test cases. The codemod may handle many more cases.
Build your own codemod and share it with the community.
1 const PropTypes = require('react');
2 const { Animated, View } = require('react-native');
3
4 function MyComponent(props) {
5 return <Animated.View {...props} />;
6 }
7
8 MyComponent.propTypes = View.propTypes;
9
10 module.exports = MyComponent;
11