callstack / callstack/react-native-paper

createMaterialBottomTabNavigator return type is any

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

説明

### Current behaviour
Using `createMaterialBottomTabNavigator` from ` "react-native-paper/react-navigation"` returns fully functional Tab navigator, but with `any` type, making it impossible to work with using Typescript.

### Expected behaviour
It should return something which will allow Intelisense to work as it should: e.g. it should instruct user to use `` or to use `component` prop in ``
### How to reproduce?
```tsx
import TabBarIcon from "@/src/components/TabBarIcon";
import { createMaterialBottomTabNavigator } from "react-native-paper/react-navigation";
import MessagesRoute from "./messages";
import Notifications from "./notifications";

const Tabs = createMaterialBottomTabNavigator();

export default function CommunicationLayout() {
return (

}}
/>
undefined }}
/>

);
}
```

### Preview

![Image](https://github.com/user-attachments/assets/0df945cc-8744-4a47-b5c9-a05c967b46fe)

### What have you tried so far?
There is no easy solution for that. I tried installing `react-navigation` and importing types, but it didn't help.

### Your Environment

| software | version
| --------------------- | -------
| ios | x
| android | 13
| react-native | latest
| react-native-paper | latest
| node | 22.13.1
| npm or yarn | pnpm - latest
| expo sdk | 53

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

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

調査の方向性

Start at the createMaterialBottomTabNavigator export from react-native-paper/react-navigation and reproduce the TypeScript example from the issue. Trace the returned navigator's type definitions and verify that Tabs.Navigator and Tabs.Screen provide IntelliSense and typed component usage without returning any.

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

評価

技術スタック
react-native, typescript
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

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

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