React native 错误:组件[ComponentName]声明了'PropTypes',而不是'PropTypes'。你把财产转让书拼错了吗?
有人可以解释为什么我在导入PropType时出现此错误: 组件CustomBackground声明了React native 错误:组件[ComponentName]声明了'PropTypes',而不是'PropTypes'。你把财产转让书拼错了吗?,react-native,react-props,react-proptypes,prop,React Native,React Props,React Proptypes,Prop,有人可以解释为什么我在导入PropType时出现此错误: 组件CustomBackground声明了PropTypes,而不是PropTypes。你把财产转让书拼错了吗 CustomBackground.js: import PropTypes from 'prop-types'; const CustomBackground=({children})=>( <ImageBackground source={background} style={styles.imageb
PropTypes
,而不是PropTypes
。你把财产转让书拼错了吗
CustomBackground.js:
import PropTypes from 'prop-types';
const CustomBackground=({children})=>(
<ImageBackground source={background} style={styles.imagebackground}>
{children}
</ImageBackground>
)
CustomBackground.PropTypes={
children:PropTypes.element.isRequired,
}
export default CustomBackground;
从“道具类型”导入道具类型;
const CustomBackground=({children})=>(
{儿童}
)
CustomBackground.PropTypes={
子项:PropTypes.element.isRequired,
}
导出默认自定义背景;