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
};