react-native-speech-bubble
react-native-speech-bubble copied to clipboard
[Crash] only on release build style undefined
com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'r.View.propTypes.style'), stack:
Only happens on release build (Emulator and devices)
<SpeechBubble onSpeechReplay={()=>{ this.setState({showreward: false}); } } speeches={[ 'You leveled up!', 'You unlocked a background!' ]} />
@UberMC How did you manage to bypass this?
Fixed this by changing in the index.js file from the package from this
const propTypes = {
allowSkip: PropTypes.bool,
allowSpeechReplay: PropTypes.bool,
onSpeechEnd: PropTypes.func,
onSpeechNext: PropTypes.func,
onSpeechReplay: PropTypes.func,
speaker: PropTypes.string,
speakerStyle: View.propTypes.style,
speakerTextStyle: Text.propTypes.style,
speechBubbleActiveOpacity: PropTypes.number,
speechBubbleStyle: View.propTypes.style,
speechBubbleTextStyle: View.propTypes.style,
speeches: PropTypes.array.isRequired,
typeWriterStyle: Text.propTypes.style,
nextStyle: View.propTypes.style,
style: View.propTypes.style,
hideIcons: PropTypes.bool,
};
to this
const propTypes = {
allowSkip: PropTypes.bool,
allowSpeechReplay: PropTypes.bool,
onSpeechEnd: PropTypes.func,
onSpeechNext: PropTypes.func,
onSpeechReplay: PropTypes.func,
speaker: PropTypes.string,
speakerStyle: ViewPropTypes.style,
speakerTextStyle: Text.propTypes.style,
speechBubbleActiveOpacity: PropTypes.number,
speechBubbleStyle: ViewPropTypes.style,
speechBubbleTextStyle: ViewPropTypes.style,
speeches: PropTypes.array.isRequired,
typeWriterStyle: Text.propTypes.style,
nextStyle: ViewPropTypes.style,
style: ViewPropTypes.style,
hideIcons: PropTypes.bool,
};
I'm also facing this issue. Using the fix from @shtefanilie I get the error: ViewPropTypes is not defined