callstack / callstack/react-native-paper

Hardcoded Icons library for Appbar Backaction and Chip

オープン
#4,760 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
TypeScript
スター
14.5k
フォーク
2.2k
平均マージ
5日 23時間
マージ済み PR(30日)
12

説明

### Current behaviour

1. An icon library is attached to the Provider of the RN Paper library.
2. The library is ignored in RN Paper components like BackAction in the Appbar or Chip
Only when explicitly calling the Icon component will it show the custom Icons

### Expected behaviour

Always fetch icons from the attached icon library

### How to reproduce?

```
import React, {useContext} from 'react';
import {Platform} from 'react-native';
import {Provider as PaperProvider} from 'react-native-paper';
import {Icon} from '@shared/assets/themes/IconTheme';
import {ThemeContext} from '@shared/assets/themes/themeContext';

export default function WithReactPaperWrapper(app: any) {
const {theme} = useContext(ThemeContext);
return (

{app}

);
}

function CustomIcon(props: any) {
return ;
}

```

### Solution

This is a snippet from `node_modules/react-native-paper/src/components/MaterialCommunityIcon.tsx`
Where it shows that it isn't fetching from the custom Icons.
```
const loadIconModule = () => {
try {
return require('@react-native-vector-icons/material-design-icons').default;
} catch (e) {
try {
return require('@expo/vector-icons/MaterialCommunityIcons').default;
} catch (e) {
try {
return require('react-native-vector-icons/MaterialCommunityIcons')
.default;
} catch (e) {
return null;
}
}
}
};
```
The snippet should be replaced by the snippet from `node_modules/react-native-paper/src/components/Icon.tsx`
```

{({ icon }) => {
return icon?.({
name: s,
color: iconColor,
size,
direction,
testID,
});
}}

```

### Your Environment

| software | version
| --------------------- | -------
| react-native-paper | 5.14.5
| expo sdk | 52.0.39

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reading src/components/MaterialCommunityIcon.tsx and src/components/Icon.tsx, then trace how Appbar BackAction and Chip render their icons through the provider settings. Confirm the affected components use the configured icon library rather than the hardcoded loader, and verify that both components display custom icons when the provider supplies one.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react-native, typescript
領域
frontend, mobile
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。