callstack / callstack/react-native-paper

createMaterialBottomTabNavigator return type is any

Abierto
#4,671 1 comentario 1 reacción 0 asignados Ver en GitHub
BottomNavigation bug
Lenguaje dominante
TypeScript
Estrellas
14.5k
Forks
2.2k
Merge medio
5 d 23 h
PR fusionados (30 d)
12

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comience con la exportación createMaterialBottomTabNavigator de react-native-paper/react-navigation y reproduzca el ejemplo de TypeScript del issue. Rastree las definiciones de tipos del navigator devuelto y verifique que Tabs.Navigator y Tabs.Screen proporcionen IntelliSense y permitan usar componentes tipados sin devolver any.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react-native, typescript
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.