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

ButtonGroup fails on iOS Expo Dev Client #3869

Open
1 task done
trajano opened this issue Dec 4, 2023 · 1 comment
Open
1 task done

ButtonGroup fails on iOS Expo Dev Client #3869

trajano opened this issue Dec 4, 2023 · 1 comment

Comments

@trajano
Copy link

trajano commented Dec 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Explain what you did

Use ButtonGroup in an iOS Expo Dev Client

Expected behavior

Works as expected

Describe the bug

Got this error

TypeError: (0, _color.default)(underlayColor).alpha(activeOpacity).rgb is not a function (it is undefined)

Appears to be used here

https://github.com/react-native-elements/react-native-elements/blob/72a4ac51ac60e305c1ef8fab4f81fdc7f0b7c9dd/packages/base/src/ButtonGroup/ButtonGroup.tsx#L204C6-L207C19

This is not "blocked" by a platform check

Steps To Reproduce

1. Create a custom dev client for Expo with the peer deps of RNEUI
2. Create a button group

        <ButtonGroup
          buttons={["English", "French", "Japanese", "System"]}
          onPress={async (nextLanguageIndex) => {
            const langs = ["en", "ja", "fr", null];
            await setLanguageAsync(langs[nextLanguageIndex]);
          }}
          // selectedIndex={isSystemLanguage ? 3 : ["en", "ja", "fr"].findIndex(it => it === language)}
        />
  1. try to load up the app in DevClient


### Screenshots

_No response_

### Your Environment

React Native Elements Env Info

## Global Dependencies:

   No related dependency found

## Local Dependencies:

 - @rneui/base : ^4.0.0-rc.8
 - @rneui/themed : ^4.0.0-rc.8
 - expo : 49
 - react : 18.2.0
 - react-native : 0.72.6
 - @types/react : ~18.2.14
@trajano
Copy link
Author

trajano commented Dec 4, 2023

It appears to be because of activeOpacity which is undefined by default.

Adding this to the theme seems to work

  components: {
    ButtonGroup: {
      activeOpacity: 1.0
    },

But why would that work around be needed? Perhaps a better workaround would be to have a platform specific file for android to skip the android_ripple computation as it is not needed.

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

No branches or pull requests

1 participant