Skip to content

Add React Navigation 7 Support #4601

@szado

Description

@szado

Current behaviour

Currently, the Bottom Tab Navigator (react-native-paper/react-navigation) cannot be used with the latest version of react-navigation (7.x) or with the latest expo-router due to changes in the react-navigation API. The issue is that useLinkBuilder now returns an object instead of a builder function.

An error occurs: buildLink is not a function.

After a brief investigation, I noticed there was an attempt to add support for react-navigation@7, but the changes were reverted.: https://github.com/callstack/react-native-paper/pull/3958/files

The fix seems quite simple; if we're dealing with v7 (the hook value is an object) we should try to call buildHref method on it.

Docs: https://reactnavigation.org/docs/use-link-builder/

Your Environment

software version
react-native-paper 5.13.1
expo sdk 52.0.25

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions