callstack / callstack/react-native-paper

createMaterialBottomTabNavigator return type is any

未关闭
#4,671 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
BottomNavigation bug
主要语言
TypeScript
星标
14.5k
派生
2.2k
平均合并
5 天 23 小时
30 天内合并 PR
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

贡献指南

打开贡献指南

调研方向

从 react-native-paper/react-navigation 的 createMaterialBottomTabNavigator 导出开始,并复现 issue 中的 TypeScript 示例。跟踪返回的 navigator 的类型定义,并验证 Tabs.Navigator 和 Tabs.Screen 能够提供 IntelliSense 和类型化组件用法,而不会返回 any。

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

评估

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

把新 issue 发到你的邮箱

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