All Questions
137 questions
2
votes
1
answer
49
views
React "Invalid Hook Call" error when I use useNavigation
Photo of Error Message
I created a Product Card in React, and in the product card, I want the user to be able to press it and navigate to another Product Detail Screen. Now, every time I initialize ...
0
votes
0
answers
38
views
Dynamically evaluated named import in react/javascript
Need to import a file depending upon the option selected from the previous screen.
Using react-navigation to get the import details.
/* Taking path information from previous screen. */
const{
...
1
vote
1
answer
303
views
TypeError: (0, _react.useFocusEffect) is not a function
I want to try using useFocusEffect on a page in my React Native app. I am importing it like so:
import React, { useEffect, useFocusEffect } from "react";
And I've added the function, with ...
1
vote
1
answer
266
views
How can i show an alert on press of a navigation back button but not when a simple button is pressed?
when i press the back button of react native navigation , the alert is shown as expected but when i press the simple Button , i want to go back without showing the alert
heres my code
const ...
1
vote
0
answers
81
views
Nested Navigators navigation and Custom TabBar issue
What I'm Trying to Achieve
I'm Trying to achieve a Tab Navigator which has Two tabs on each side which don't redirect to a different tab but instead open their respective Side Drawer as shown in the ...
0
votes
1
answer
57
views
How to send updated state variable to another component in react native
Example code:
export default function Cart() {
const navigation = useNavigation();
// Stores the selected image URI
const [file, setFile] = useState('');
// Stores any error message
...
1
vote
2
answers
2k
views
Render dynamically Markdown Content in interactive React Code with Hooks (Different number/order of hooks problem!)
Bonjour!
I want to create an mobile App which renders content written in markdown, similar to Obsidian. So far I successfully used the library react-native-markdown-display to render markdown pages ...
1
vote
0
answers
59
views
Conditional Rendering on BottomTab Navigator not working
So what i am trying to do is that I am doing conditional rendering of my AccountStack and AuthStack on my AccountTab, now my AuthStack contains screens Welcome, Login and Otp and after entering the ...
0
votes
0
answers
82
views
React Navigation - Abstract useNavigation hook and use setOptions
So I'm trying to abstract away React Navigation's useNavigation hook so that
I can call something more specific like setBackButton() instead of navigation.setOptions({...})
If we move to a different ...
1
vote
0
answers
294
views
React Navigation deep link and Splash screen useEffect conflicting causing double navigation behavior
I'm working on our deeplinking behavior. We currently use react-navigation deeplinking to handle income url deeplink requests. However, we also have a hook that redirects a user from the splash screen ...
1
vote
0
answers
480
views
Using useContext with React Navigation in React Native
My goal is to have a trackList variable in my Host.js file which is initially set to an empty list but can be updated using setTrackList. Even after closing this page and reopening, I do not want the ...
0
votes
1
answer
251
views
react-native find screen the was idle to logout
I have tried panResponder to check the screen idle. but it doesn't work. i am not sure, what mistake i done.
const timerId = useRef(false)
const [timeForInactivityInSecond, ...
0
votes
1
answer
312
views
Expo av doesn't pause on navigation.goBack()
I have 3 screens, A, B and C. On B, I have an audio autoplaying. I have a Header which allows me to go forward to C or backward to A.
I have tried the code below. While the sound does stop when going ...
2
votes
0
answers
133
views
React Native state gets reseted when navigation.goBack() is used in realm schema listener
I have a listing screen where I list some data, and another one for data input. When the listing screen opens, I fetch the data from the local database and put them in the state. And also set up ...
0
votes
1
answer
51
views
In react-native the variable is getting rendered but the value is not getting passed to the child screen
New to React/React-Native
After authentication the Home page opens, it has two tabs "Payment" and "Notice". I want to access the user email and location in payment tab. The email ...