At this moment the way we can define View style propTypes is with helper ViewPropTypes which can be imported from 'react-native' package.
But eslint consider a typo here because of rule react/no-types:
AnyComponent = ({ style }) => (
<View style={style}>
<Text>Hi!</Text>
</View>
);
AnyComponent.propTypes = {
style: ViewPropTypes.style, // eslint-disable-line react/no-typos
};
Can be reproduced with extending .eslintrc with qlean-react-native config.
npm install -D eslint-config-qlean-react-native \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected]
Is ViewPropTypes imported from somewhere?
@ljharb Yep, it's imported from react-native package:
import { ViewPropTypes } from 'react-native';
It's created for using in component PropTypes, when component extends View or using some of it props.
This works well in the latest version, @vadimshvetsov would you be able to update?
Yes, it's working in v7.11.1, thanks @alexzherdev
Most helpful comment
This works well in the latest version, @vadimshvetsov would you be able to update?