ReactNative v44以降ではViewPropTypes.style
を使う
import {ViewPropTypes} from 'react-native'
export default class MyClass extends Component {
static propTypes = {
style: ViewPropTypes.style
}
}
これまでは View.propTypes.style
が使えたがDeprecatedになった。
使うと下記の警告が表示される。
Warning: View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead.