首页 > 解决方案 > iOS:发布模式下的应用程序崩溃。错误:未定义不是对象(评估'a.View.propTypes.style')

问题描述

是的!有很多与此相关的问题和答案,但在每个解决方案中,所有人都说要替换View.propTypes.styleViewPropTypes.style. View.propTypes.style但是在我的项目中,整个项目中没有可用的代码。

如果在我的项目View.propTypes.style中不可用,那么我可以在哪里替换?

完整错误:

undefined is not an object (evaluating 'a.View.propTypes.style')
 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: undefined is not an object (evaluating 'a.View.propTypes.style')
[290:10014] Unhandled JS Exception: undefined is not an object (evaluating 'a.View.propTypes.style')
[290:10014] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: undefined is not an object (evaluating 'a.View.propTypes.style')', reason: 'Unhandled JS Exception: undefined is not an object (evaluating 'a.View.prop..., stack:
<unknown>@1022:1541
t@2:620

作为参考,我propTypes在下面使用过,但我认为这不是问题。

const propTypes = {
    data: PropTypes.array,
    onChange: PropTypes.func,
    initValue: PropTypes.string,
    style: ViewPropTypes.style,
    selectStyle: ViewPropTypes.style,
    optionStyle: ViewPropTypes.style,
    optionTextStyle: Text.propTypes.style,
    sectionStyle: ViewPropTypes.style,
    sectionTextStyle: Text.propTypes.style,
    cancelStyle: ViewPropTypes.style,
    cancelTextStyle: Text.propTypes.style,
    overlayStyle: ViewPropTypes.style,
    cancelText: PropTypes.string
};

标签: iosreact-nativereact-proptypesxcode9.3

解决方案


推荐阅读