All Questions

Filter by
Sorted by
Tagged with
177votes
6answers
178kviews

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 ...
user avatar
  • 2,365
86votes
4answers
55kviews

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 ...
user avatar
  • 5,994
66votes
5answers
97kviews

how to async/await redux-thunk actions?

action.js export function getLoginStatus() { return async(dispatch) => { let token = await getOAuthToken(); let success = await verifyToken(token); if (success == true) { ...
user avatar
  • 1,061
52votes
5answers
89kviews

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 ...
user avatar
  • 853
47votes
3answers
60kviews

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 ...
user avatar
  • 7,246
38votes
2answers
64kviews

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 ...
user avatar
  • 8,577
37votes
4answers
18kviews

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, ...
user avatar
  • 1,673
33votes
9answers
32kviews

How to pass props to Screen component with a tab navigator?

This is my first post on StackOverflow, so apologies if I'm not following the correct format. I'm building my first app using tab navigator from React Navigation v 5.x and have run into a big problem ...
user avatar
  • 331
31votes
13answers
14kviews

Unable to resolve module `./../../react-transform-hmr/lib/index.js`

error: bundling failed: Error: Unable to resolve module ./../../react-transform-hmr/lib/index.js from /ReactNative/UsermanagementNav/src/App.js: The module ./../../react-transform-hmr/lib/index.js ...
user avatar
30votes
2answers
22kviews

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 ...
user avatar
  • 2,181
29votes
11answers
35kviews

The react-scripts package provided by Create React App requires a dependency:

There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally. The react-scripts package provided by Create React App ...
user avatar
27votes
7answers
14kviews

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 ...
user avatar
  • 369
26votes
7answers
33kviews

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 ...
user avatar
  • 9,359
22votes
3answers
47kviews

How to close the modal in react native

I am newbie to react native developing. I want to close the modal component on pressing outside the modal in reactnative. Below is my code. state = { visibleModal : false, }; _hideModal(){ ...
user avatar
  • 687
22votes
1answer
12kviews

How do I persist state for android apps killed in the background in react-native

When an Android App is sent to the background, it can persist its instance state in case it gets killed due to low memory (see Activity:onSaveInstanceState() and the bundle argument for Activity:...
user avatar
  • 2,026

15 30 50 per page
1
2 3 4 5
239