NativeBase: Button.js theme backgroundColor: null crashing on RN 0.59.1 Android NoSuchKey Exception: backgroundColor

I have gone through these following points

Issue Description

node, npm, react-native, react and native-base version, expo version if used, xcode version

RN . 0.59.1 Android… native-base 2.12.1

Expected behaviour

Using custom theme via ejectTheme.js should work on iOS and Android.

Actual behaviour

Android release crashing with error: NoSuchKeyException backgroundColor when using transparent and/or disabled style for Button… native-base-theme/components/Button.js has multiple background: null entries… changing these to background: transparent appears to resolve isssue.

Steps to reproduce

Is the bug present in both iOS and Android or in any one of them?

only Android, only release

Any other additional info which would help us debug the issue quicker.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 21 (4 by maintainers)

Commits related to this issue

Most upvoted comments

this definitely needs an urgent fix, <Button transparent /> totally breaks at the moment.

Fixed in #2799. Will be available with the next version.

Temporary workaround:

<Button transparent style={{backgroundColor: 'transparent'}}>

Guys, changing all instances of backgroundColor:null to backgroundColor:“transparent” in the Buttons.js native-base-theme solved my issue… in case you ejected the theme

Please try our latest release v.2.12.5.

The fix right now is adding style with backgroundColour: ‘transparent’ Its very annoying @SupriyaKalghatgi decided to not bother with this simple fix

For us it was line 177 of the native base theme file native-base/components/Button.js

Changing it to backgroundColor: ‘transparent’ resolves it for us.

@SupriyaKalghatgi whats happening with your organization?

[eng] also crashes with such parameters in the Button component <Button transparent dark>{this.props.children}</Button> one by one, the props data works fine, everything falls together

[rus] также же крушится при таких параметрах в компонент Button <Button transparent dark>{this.props.children}</Button> по одиночке данные props нормально работает, вместе все падает

@dguillamot if you change any backgroundColor: null to backgroundColor: 'transparent', it fixes the issue