All Questions
2,388 questions
-1
votes
1
answer
65
views
UseEffect being run twice when value changes from context in React Native [duplicate]
I am working on developing an app on React Native and I am encountering an issue with a useEffect inside a component being run multiple times simultaneously when the shared state from context changes (...
0
votes
1
answer
69
views
UseEffect doesn't get called in a child component
I have a React Native app that has this screen called TasksScreen:
export default function TasksScreen() {
const [loading, setLoading] = useState<boolean>(true);
const colorScheme = ...
1
vote
2
answers
79
views
Purpose of a `useEffect` with empty logic
Consider the below component:
export const HomeScreen = observer(() => {
const {
languageStore: { refresh },
} = useStores()
const [visible, setVisible] = useState(false)
// *** DO ...
-1
votes
1
answer
52
views
Maximum update depth exceeded when using useEffect with state updates
I'm facing a "Maximum update depth exceeded" error in my React Native application. The issue occurs when I uncomment the DropDownPicker component in my CropsGraph component. Here's the flow ...
0
votes
0
answers
59
views
How to exit app when back button is pressed and drawer is opened?
The goal is to ensure that when the drawer is open and on pressing the back button should exit the app instead of closing the drawer. However, the issue is that the BackHandler is triggering even when ...
0
votes
0
answers
27
views
React Native - Hook set function returns undefined after being set with a proper value [duplicate]
export function AlbumCover({ query, style }: QueryProps) {
const [release, setRelease] = useState<IReleaseGroupMatch>();
useEffect(() => {
mbApi
.search("release-group"...
0
votes
0
answers
32
views
Scroll continuously while condition is true using React Native's ScrollView
I'm currently implementing a drag-and-drop list using react-native-gesture-handler. The list is implemented as a simple Array.map() within a ScrollView since a FlatList would be incompatible with some ...
0
votes
1
answer
62
views
In React native, how to swap a two select component values onPress?
Trying to swap the values of the two components on Icon Press.
I have two components with Source Language and Destination Language, when the user press the Switch Icon then the values of the two ...
0
votes
1
answer
39
views
In React Native SetState isnt working in the initial rendering index.js even my functions giving desired output like true or false
this is what i m trying, in the functions of conrtrolFirstLaunch and getAuthentication i m getting the log of both data and auth but state isnt updating, i dont know why is this happening but before ...
0
votes
1
answer
69
views
Best way to synchronize state variables [duplicate]
I'm new to react native and am trying to create onboarding for my app, this is a simplified version. To stop the user from half answering my onboarding questions and allowing them to mess up the user ...
0
votes
0
answers
35
views
React Native preventing re-rendering of object element in array that is not updated
I am trying to figure out this for days, but my component ImageComponent is flickering when I click add or remove for all the elements in the array. I think the issue is that all elements in the array ...
-1
votes
1
answer
98
views
Rendering different component based on dropdown selection
I am working on a dashboard in which there is a main menu with multiple options. When the user selects a menu option, it will take them further to a dropdown menu. The dropdown menu will have ...
1
vote
1
answer
75
views
React Native useCallback uses initial state values
I have the following setup when I want to track a bunch of metadata when a user listens to an audio from my app. However, for some reason, length_played always remain 0 and time_listened is inaccurate....
0
votes
1
answer
46
views
Rules for Hooks in React Native
Are the same rules for hooks in React applicable to React Native:
There are 3 rules for hooks:
Hooks can only be called inside React function components. [Add React Native Components]
Hooks can only ...
0
votes
1
answer
47
views
React/React native state not updating
I know that this is some silly question but trust me i the state is not updating and i am unable to know why, I'm trying from hours but still its always same, below is my simple useEffect :
const [...