21 questions
1 vote
1 answer
38 views
React Native App only setting to state on second load
I am currently working on the capstone for my course, but I have to use multiple async functions. I need to use AsyncStorage, SQLite storage, and fetching from a REST API. The issue I am encountering ...
3 votes
0 answers
680 views
Why is my TextInput out of sync with state when I give rapid inputs?
I'm creating a typing race game with React Native which is producing an unexpected bug on Android. When the user finishes typing a word/spacebar, I set the input state to an empty string. However, if ...
0 votes
1 answer
990 views
React-native: How to update parent's state from child component?
I've a parent-child component structure, where parent fetches data to be displayed and child component displays the data. I want to update parent's state from child component. I'm sending a handler ...
0 votes
1 answer
2k views
React Native textInput clear
I have a textinput like this: <TextInput secureTextEntry={true} autoCompleteType="password" onChangeText={val => setClave(val)} /> and the component ...
0 votes
1 answer
1k views
Remove an item from FlatList render wrong items
I know that it has been asked several times, but in all the other threads the problem is that the author is manipulating the state directly - which I don't (hopefully). I've got an array of posts that ...
1 vote
1 answer
1k views
OnResume in react native screen of Android
I have a screen in react native for android. I wanted to do some operation when particular screen(implemented in react-native) alone resumes as like fragment's onresume() in java/kotlin How shall i ...
0 votes
2 answers
498 views
Convert class component state to functional component
I'm learning react native. I didn't figure out this problem. I have been using functional component in my project. Here is i don't understand to convert class component state : constructor(props) { ...
1 vote
1 answer
692 views
Is it possible a state that among two screen and able to setState from the two screens?
I have occured this problem on my project.I really confused what I'm gonna do.
3 votes
2 answers
164 views
React native: setState did not update immediately
I'm trying to make a TicTacToe game for an android app. The TicTacToe's game mode that I'm intended to make is Human-vs-Computer. But the problem is the program did not update the switching-procedure (...
0 votes
1 answer
687 views
Update style from state in react native with typescript
I am using react native with typescript, and I wanted to update my style property from the state. But it is giving me error. const [VerifiedCheck, setIsVerifiedCheck] = useState("flex"); &...
0 votes
1 answer
902 views
Why does AsyncStorage save an empty array with the first click and then save the entered value only with the second button click in react native
I try to save the tasks in my ToDo app with AsyncStorage so that they can be retrieved after an app restart. So far I have managed to save the tasks. However, an empty array is always saved in the ...
0 votes
2 answers
61 views
React Native state not updating through useSate Methed of React
what's seems to be the problem in my code, i am createing a firestore & firebase based Application. Till now everything working fine but Now i want to add a unique key starting from 1 and then ...
3 votes
0 answers
380 views
React native doesn't update state after autocomplete in textinput
I'm working on a messaging app with the following code: const MessageCentral = () => { const [inputText, onChangeText] = useState(''); const [bodyText, updateText] = useState(""); ...
1 vote
2 answers
2k views
TextInput onChangeText set useState value is not working in React Native Testing with Enzyme
I want to test that user should not navigate to any other screen if TextInput equals to "". I have tried to put console logs to understand more correctly but the problem is now that, after ...
0 votes
0 answers
268 views
Why Login page doesn't reset state when navigating to Home page?
I am using react-navigation and when a user logs in, it redirects to Home screen. However, when I go back to Login, I can see the state is not reset. Basically, it is keeping state the same as I left ...