2

Yes! There are many questions and answers related to this but in every solution, all people say to replace View.propTypes.style with ViewPropTypes.style. But in my project, there is not View.propTypes.style code available in the whole project.

If in my project View.propTypes.style is not available then where can i replace?

Full error:

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

For reference i have using propTypes at below point but i think it's not an issue.

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
};
Vvk
  • 4,031
  • 29
  • 51
  • Also check your node_modules folder. Some libraries may be using it. – Nakamura Sep 17 '18 at 22:35
  • @Nakamura I have checked everywhere in my directory. also, I searched this in whole project and directory with command but there is no specific word is available in the directory. – Vvk Sep 19 '18 at 05:43
  • check out https://stackoverflow.com/questions/34626298/how-to-declare-style-in-proptypes/39627920#39627920 – Itachi_rg Apr 16 '19 at 04:53

0 Answers0