ButtonGroup fails on iOS Expo Dev Client

未关闭
#3,869 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react-native, typescript
领域
mobile-dev

调研方向

Start in packages/base/src/ButtonGroup/ButtonGroup.tsx at the referenced lines around 204-207, then reproduce the error with the provided Expo 49 and React Native 0.72.6 setup in an iOS Expo Dev Client. Done means ButtonGroup loads and works as expected without the reported TypeError.

由索引模型根据 Issue 内容生成。

描述

Needs Triage
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
主要语言
MDX
星标
25.9k
派生
4.7k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

react-native-elements/react-native-elements 的其他 Issue

查看 react-native-elements/react-native-elements 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。