callstack / callstack/react-native-paper

createMaterialBottomTabNavigator return type is any

Open
#4,671 1 comment 1 reaction 0 assignees View on GitHub
BottomNavigation bug
Dominant language
TypeScript
Stars
14.5k
Forks
2.2k
Avg merge
5d 23h
Merged PRs (30d)
12

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.