Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
255 votes
4 answers
450k views

Axios get in url works but with second parameter as object it doesn't

I'm trying to send GET request as second parameter but it doesn't work while it does as url. This works, $_GET['naam'] returns test: export function saveScore(naam, score) { return function (...
Sinan Samet's user avatar
  • 6,682
196 votes
10 answers
221k views

How do I add an element to array in reducer of React native redux?

How do I add elements in my array arr[] of redux state in reducer? I am doing this- import {ADD_ITEM} from '../Actions/UserActions' const initialUserState = { arr:[] } export default function ...
coderzzz18's user avatar
  • 2,625
112 votes
10 answers
236k views

useDispatch() Error: Could not find react-redux context value; please ensure the component is wrapped in a <Provider>

I am trygin to use React-Redux library and I am getting the error on the title. I wrapped my components with Provider but I still get the error, only if I implement the useDispatch() hook. The app ...
MIPB's user avatar
  • 2,291
96 votes
4 answers
118k views

Subscribe to single property change in store in Redux

In Redux I can easily subscribe to store changes with store.subscribe(() => my handler goes here) But what if my store is full of different objects and in a particular place in my app I want to ...
Rocky Balboa's user avatar
  • 1,486
88 votes
4 answers
58k views

Passing props to react-redux container component

I have a react-redux container component that is created within a React Native Navigator component. I want to be able to pass the navigator as a prop to this container component so that after a button ...
Mike's user avatar
  • 6,199
73 votes
5 answers
44k views

Nested redux reducers

Is it possible to combine reducers that are nested with the following structure: import 'user' from ... import 'organisation' from ... import 'auth' from ... // ... export default combineReducers({ ...
AndrewMcLagan's user avatar
61 votes
4 answers
41k views

How to use Redux to refresh JWT token?

Our React Native Redux app uses JWT tokens for authentication. There are many actions that require such tokens and a lot of them are dispatched simultaneously e.g. when app loads. E.g. ...
lanan's user avatar
  • 2,742
60 votes
6 answers
88k views

Wipe AsyncStorage in react native

I notice that I am wasting a certain amount of time debugging redux actions that I am persisting to AsyncStorage in react-native thanks to redux-persist. Sometimes I'd just like to wipe AsyncStorage ...
jsdario's user avatar
  • 6,745
49 votes
3 answers
67k views

Could not find "store" in either the context or props of "Connect(App)"

I'm having problems with misconfigured Redux after merging contents of multiple files into one to serve as config for Redux. How to resolve store, while keeping this in one file? Unhandled JS ...
Peter G.'s user avatar
  • 7,954
46 votes
4 answers
25k views

React Redux: Should reducers contain any logic

I have a cart reducer function with add, update and delete cases. I also have a product array within the redux store. When there are two items added to the product array, instead of having two items, ...
IVI's user avatar
  • 2,078
43 votes
2 answers
80k views

React-redux component does not rerender on store state change

I'm stating to learn react and redux today, yet I cannot figure out how to force component to rerender after state change. Here is my code: const store = createStore(loginReducer); export function ...
Momen Zalabany's user avatar
34 votes
7 answers
47k views

Global state in React Native

I am developing a React Native application. I want to save the user id of the person who is logged in and then check if the user is logged in in every single component. So what I am looking for is ...
Jamgreen's user avatar
  • 10.9k
30 votes
2 answers
23k views

How do you mix componentDidMount() with react-redux connect()?

This seems like a simple use case but I can't figure it out. I want to display a list of items retrieved from a request to a remote API over HTTP. I would like the screen to show blank initially while ...
evilfred's user avatar
  • 2,396
30 votes
4 answers
19k views

Proper way to navigate with React Native, Redux, and Navigator

I have a React Native app using the Redux framework and I'm using the Navigator component to handle navigation. I've had a little bit of trouble getting the navigation working and I'm not able to find ...
Denny Ferrassoli's user avatar
29 votes
3 answers
8k views

Architecture in a react native app using WebSockets

I have a React Native app I'm going to be building that uses WebSockets. I have a WebSocket library written in JavaScript and I'm simply re-using it for this project, which is fantastic. My question ...
randombits's user avatar
29 votes
1 answer
8k views

Using Realm in React Native app with Redux

I am about to undertake the development of a React Native app and am thoroughly convinced of the benefits of managing the app's state using Redux, however I'd like to make the app's data available ...
oldo.nicho's user avatar
  • 2,279
28 votes
3 answers
27k views

React Redux - Is adding async method in a Reducer an anti pattern?

I'm pretty new to the whole react-native / redux world, so maybe this question will sound dumb :) I know that for an API call, or stuff like that, the convention is to use middleware, but is it ...
alan_langlois's user avatar
28 votes
1 answer
11k views

Relay vs Redux vs Apollo with GraphQL and React-Native [closed]

I have to start a new (web + native) project (mid-size app) from scratch. Due to the plethora of JS frameworks and implementation out there especially in the last couple of years, I have been having a ...
0xburned's user avatar
  • 2,635
27 votes
5 answers
84k views

How to slide <View/> in and out from the bottom in React Native?

In React Native iOS, I would like to slide in and out of a like in the following picture. In the following example, when a button is pressed, the Payment Information view pops up from the bottom, ...
Jo Ko's user avatar
  • 7,475
27 votes
7 answers
15k views

React.default.memo is not a function (React-Native) wrapWithConnect

I get this the error _react.default.memo is not a function and wrapWithConnect. This is a react-native project and it worked fine before I used the connect function to connect my dispatch into ...
phaseTiny's user avatar
  • 385
26 votes
3 answers
19k views

React Native + Redux basic authentication

I'm looking for a way to create a basic authentication for my react-native app. I couldn't find any good example for react-native app. To login, the app sends the email/password + clientSecret to my ...
alexmngn's user avatar
  • 9,387
22 votes
1 answer
4k views

State Management for Animations Using React Native and Redux

Background I've been building an application using React Native & Redux to make an assessment over whether to use it for an upcoming project over Swift and going fully native. I genuinely believe ...
Matt Lacey's user avatar
  • 8,245
21 votes
6 answers
20k views

React native + redux-persist: how to ignore keys (blacklist)?

I'm storing my settings with redux-persist and would like to ignore some of them to have them reset on every restart, e.g. after a crashing. It's possible to add an array of reducer-names as ...
Mr. B.'s user avatar
  • 8,469
20 votes
2 answers
11k views

React Native: Animation when component unmounts

I have a custom modal which slides in upon componentDidMount: componentDidMount() { Animated.timing(this._animatedValue.y, { duration: 200, toValue: 0 }).start() } Ok, ...
ThorbenA's user avatar
  • 1,893
19 votes
7 answers
16k views

What is a difference between action,reducer and store in redux?

I am new to react/redux. I am trying to figure out how all the pieces in redux interact. The one thing giving me trouble is understanding the relation between actions and reducers,store.
Dishant Chanchad's user avatar
19 votes
2 answers
13k views

Export REACT_EDITOR for VSCode

How do you complete the following PRO TIP from the Android emulator node using the Windows cmd line for VSCode? "When you see Red Box with stack trace, you can click any stack frame to jump to the ...
Carl's user avatar
  • 321
19 votes
4 answers
14k views

What are options to debug a React Native + Redux app?

I have been researching options to debug a React Native + Redux app. Especially the redux part. What is your preferred way to do this? Hope to know!
Tetsuya3850's user avatar
18 votes
9 answers
31k views

React Native - React Navigation slow transitions when nesting navigators

I am building a cross-platform native application using react-native and using react-navigation for navigating to and from screens and managing navigation state using redux. The problem arises when I ...
Shivansh Singh's user avatar
18 votes
5 answers
11k views

How to make React Native mobile application faster?

React Native mobile application is working very slow on every click. I am using react native v0.40.0 and following are the dependencies of my project. { "analytics-react-native": "^1.1.0", "...
Kishan Vaghela's user avatar
18 votes
4 answers
21k views

How to use react j s components in react native app?

Is it possible to use all the reactjs components in react native app?If no,what is the best way to switch between react js and react native? If an app is done using react js is it necessary(...
Subramaniyan Narayanan's user avatar
17 votes
6 answers
18k views

ScrollView minHeight to take up all the space

I have a ScrollView which content doesn't necessarily exceeds it's size. Let's say it's a form where, upon errors, it expands to add error messages and then it exceeds the ScrollView size and thus is ...
Felipe92's user avatar
  • 351
17 votes
2 answers
22k views

Avoid status bar overlap on all screens

I want all screens on my app to appear below the status bar on both iOS and Android, so I'd either have to add a StatusBar component or a paddingTop to all my screens. Is there a way to do this ...
Avery235's user avatar
  • 5,156
17 votes
2 answers
13k views

mapDispatchToProps: any point?

I was wondering if there was still a point using mapDispatchToProps today. I'm working on the redux documentation tutorials (to build a todo list) where VisibleTodoList is described as: import { ...
Thanh-Quy Nguyen's user avatar
17 votes
3 answers
29k views

How to Cache API data using AsyncStorage React Native

Fairly new to React native and its concepts. I have been playing with RN for a while to create an application to fetch API data from http://jsonplaceholder.typicode.com/photos I have been looking ...
Jatin Suneja's user avatar
17 votes
2 answers
8k views

default values from initial state are loaded before store rehydrates with redux-persist

I'm having trouble accessing saved data after app starts with redux-persist. The reducer initializes with data defined in my initial state. By the time the previous session's state loads with ...
amirfl's user avatar
  • 1,644
17 votes
3 answers
2k views

Router state not being persisted in react-native with redux

I have the following redux configuration in react-native using react-native-router-flux and redux-persist. I want to retrieve the last current route on refresh, however the route stack is being ...
jsdario's user avatar
  • 6,745
16 votes
5 answers
33k views

React-native android back button in react-navigation

Well, I have a react-native app with multiple screen, each screen having a top bar where a back button is situated, it's main behavior is that the app returns to the main screen when this button is ...
Eugen-Andrei Coliban's user avatar
16 votes
5 answers
28k views

React Redux use HOC with connected component

I am in the middle of my first React Native project. I would like to create a HOC that deals purely with syncing data from an api. This would then wrap all my other components. If I am correct my ...
mtwallet's user avatar
  • 5,050
16 votes
2 answers
3k views

Load redux store initial state in Detox Testing

Problem We have a quite complex application and we don't want in each test case to go through the whole process to get to specific screen to test it, alternatively we just want to jump to specific one ...
AFGhazy's user avatar
  • 181
16 votes
3 answers
9k views

Where to put API calls in React/Redux architecture?

I am trying to retrieve some data from an API and pass it into my application. Being new to React/Redux however, I am wondering where to make these calls from and how to pass it into my application? I ...
Peter Zacharias's user avatar
16 votes
1 answer
6k views

Redux in React Native app is very slow with lots of data

I have a large array of JSON objects I’m storing in a single Redux variable (~8k items, each with object about 1kb each for a total of 8mb). This seems to make Redux calls slow even for the most ...
tassock's user avatar
  • 1,653
15 votes
4 answers
14k views

Possible to dispatch an action without connect?

export default class App extends Component { ... componentDidMount() { //registering event listener BackgroundGeolocation.on('location', this.onLocation, this.onError); } onLocation(...
Isaac's user avatar
  • 12.7k
15 votes
4 answers
16k views

withNavigation can only be used on a view hierarchy of a navigator

I'm getting the error: Invariant Violation: withNavigation can only be used on a view hierarchy of a navigator. The wrapped component is unable to get access to navigation from props or context ...
BeniaminoBaggins's user avatar
15 votes
2 answers
24k views

How to pass parameters with redux-saga

as an exercise for react-native & redux-saga, I am trying to develop a little Weather-Application. While fetching and presenting the data works just fine, I somehow struggle to pass a parameter ...
dave's user avatar
  • 173
15 votes
1 answer
1k views

Synthetic scene stack (history) with React Native Router Flux

Is there any way how to synthetically define scene stack (history) with React Native Router Flux? Let's say I have an app, where the user can naturally navigate from A –> B –> C. I'd like to ...
sealskej's user avatar
  • 7,401
14 votes
3 answers
20k views

redux-saga: How to create multiple calls/side-effects programmatically for yield?

With redux-saga, one can execute multiple effects in parallel: import { call } from 'redux-saga/effects' // correct, effects will get executed in parallel const [users, repos] = yield [ call(...
itinance's user avatar
  • 12.2k
14 votes
2 answers
15k views

How and where to save the whole redux store using AsyncStorage

I was wondering if I have to do something like this to save the whole store of my app using AsyncStorage in my react-native app and check if it exists when the app is starting. var store; ...
Luis Rizo's user avatar
  • 2,099
14 votes
4 answers
9k views

How to fix '_react["default"].memo is not a function. (In '_react["default"].memo(connectFunction)' error in React native?

I am trying to connect Redux mapStateToProps() and mapActionCreators() to Login Screen through Container and I am using React navigation. After build my app the following error message appears: ...
Ahmed Saeed's user avatar
14 votes
1 answer
17k views

How can I use redux persist for only one reducer not for navigation reducer in my react native application?

I am using Redux persist to persist my store for reducers. My application has two reducers Navigation and User Reducer.I want to persist only user state but I have to persist both states according to ...
coderzzz18's user avatar
  • 2,625
14 votes
2 answers
5k views

React-Navigation: Use/Change header title with Redux state

Is it possible to access the whole Redux state inside the React Navigation's header title? The official docs says that the state corresponding to the navigation is accessible: static ...
jeanpaul62's user avatar
  • 10.3k

1
2 3 4 5
75