Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crash] only on release build style undefined #10

Open
UberMC opened this issue Jun 20, 2018 · 3 comments
Open

[Crash] only on release build style undefined #10

UberMC opened this issue Jun 20, 2018 · 3 comments

Comments

@UberMC
Copy link

UberMC commented Jun 20, 2018

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!' ]}
/>

@shtefanilie
Copy link

@UberMC How did you manage to bypass this?

@shtefanilie
Copy link

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

@OliverLSanz
Copy link

I'm also facing this issue. Using the fix from @shtefanilie I get the error: ViewPropTypes is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants