callstack / callstack/react-native-paper

React Navigation and Portal

Ouverte
#4,022 8 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
Portal question
Langage dominant
TypeScript
Étoiles
14.5k
Forks
2.2k
Merge moyen
5 j 23 h
PR mergées (30 j)
12

Description

I'm working with React Native Paper and React Navigation and am attempting to display a Dialog that appears above one of my screens and provides a list of cards. Each card, when clicked on, should navigate the user to a details screen. I'm attempting to use the Portal component to render the Dialog above the current screen. However, I'm currently getting the following error when clicking on the cards: "Uncaught Error: Couldn't find a navigation object. Is your component inside NavigationContainer?"

This appears to be because, as the documentation for Portal states "Portal allows rendering a component at a different place in the parent tree", which I take to mean completely outside of the top-level App component (and therefore outside of NavigationContainer").

My question is, does React Native Paper provide any way for Portal to access the navigation object for the rest of the app, or will I need to implement a custom Component that provides the same layout as Portal (i.e. the elevated, shaded background that my Dialog is displayed in)?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par reproduire l’erreur avec Portal et Dialog de React Native Paper à l’intérieur d’un React Navigation NavigationContainer. Suivez la manière dont Portal déplace Dialog et dont l’appel de navigation de la carte résout son objet de navigation. Le travail est considéré comme terminé lorsqu’une approche de navigation prise en charge est documentée ou que la limitation et la limite d’intégration requise sont clairement décrites.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
react-native
Domaine
mobile
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.