Questions tagged [react-redux]

Official React bindings for Redux

Filter by
Sorted by
Tagged with
0
votes
2answers
25 views

React: How to disable close element, while another is open?

We have a menu. If menu is open, We should be able to close it by clicking anywhere: class Menu extends Component { componentWillMount() { document.addEventListener("click", this....
1
vote
1answer
16 views

Authentication issue - previous user data is shown

I have an issue with react/redux and authentication - the authentication part works well, I can log in and log out. The problem occurs when I log out with one user and log in with another - it ...
0
votes
2answers
21 views

Does react component gets unmounted and remounted whenever redux store is updated?

My component has a button. By clicking the button, an action is dispatched and corresponding API call is made. Response from the API call is stored in redux. But whenever there is an update to the ...
0
votes
1answer
18 views

How to write a test for conditional rendering component depended on useState hook in React?

I'm trying to write a test for my functional component, but don't understand how to mock isRoomsLoaded to be true, so I could properly test my UI. How and what do I need to mock? import React, { ...
1
vote
2answers
38 views

How to set focus on rendering redux form dynamically created in loops

I am using Redux-form, I need to set focus on the text box when rendering on button click, I have already using autoFocus but it will work on the second index of the loop also i have used document....
0
votes
2answers
44 views

How to access redux store in custom api handler react javascript class

I am working on react native app. I am storing accesstoken in store after login. In every api call i have to pass this token as a header, but token has some expiry. So i have written one Apihandler ...
0
votes
0answers
23 views

warning.js?6327:33 Warning: Unknown prop `store` on <provider> tag. Remove this prop from the element

n my project, I am trying to combine two reducers but whenever I try to combine them using combineReducers({}) my props become undefined and my state enter image description here ( from store....
1
vote
1answer
34 views

Element type is invalid: expected a string or a class/function (for composite components) but got: undefined

I have made a separate component which can be considered as a child which I am calling in a parent component. While calling the component by importing it properly I am facing this issue I have tried ...
0
votes
1answer
16 views

How to send some parameter(dynamic path) from mapDispatchToProps to the watcherSaga/workingSaga (middleware)?

I just want to send some extra parameters when there is an action call "GET_NODES_ASYNC", I need to send the path along with it so that this path could be sent to the workingSaga for API call via ...
0
votes
1answer
46 views

React Component not re rendering when the state got updated

The React component is not rendering when the redux store is getting updated. If I am using set timeout I can able to see the data in the console. Why the component is not rendering. What is the ...
0
votes
1answer
25 views

Accessing Redux Store outside of React Component returns initial Values

In a React Redux app based on the Keftaa/expo-redux-boilerplate boilerplate that uses redux-persist, how can we access the persisted Redux store from a non-React component? Problem: I am not sure how ...
0
votes
1answer
13 views

Why is the state change not making it's way to the reducer?

I have a file called Login.js in the file I call this.props.onUserLogin and pass the users auth token. I can verify that I am getting the token from the api call via the console log. When I get to the ...
1
vote
1answer
39 views

Redux devTools shows difference in state, but React component won't update

I have a React app with buttons that fetch recent bills and top donors for each Congress member. Both actions (fetchBillsByRep and getRepFinances) fetch correct data and correctly update Redux state. ...
0
votes
0answers
17 views

Test fetch then catch in a thunk using jest

I have a thunk function to fetch image using remote url and upload it to a server. The thunk function is working as expected but I am not able to test the fetch then catch chain here using jest. ...
0
votes
1answer
20 views

How to share Redux logic between React and React Native

I am trying to build a boiler plate for either back-end and front-end (web with React and mobile with React Native). I would like the front-end to have a shared directory for Redux files. But when I ...
0
votes
0answers
19 views

Implementing React native maps with redux

Can anyone recommend me some articles / docs or (better yet) tutorials on a comprehensive implementation of Redux with React-Native-Maps? I am currrently working on a project that would requires such. ...
0
votes
1answer
12 views

props in functions not calling the function

I'm trying to fix a problem from the code and don't understand why is not working. Function: export const monthlyKpiActions_disp = (threeMonthsBefore, currentDate) => { console.log('...
1
vote
1answer
12 views

How to get more the tow subcollections from a rootcollection

My database structure so: |- services (root-collection) |---- doc1 |-------- reviews (sub-collection 1) |------------- subdoc1 |------------- subdoc2 ... |-------- inquires (sub-collection 2) |-------...
2
votes
2answers
54 views

Change font weight to bold for a drop down value in reactjs

I have the following code in return. It is creating a drop down values. I want to change the font weight of the drop down value for ${status} and ${dataIdText} to bold <Modal.Body className="...
1
vote
1answer
39 views

How to fix 'First visit render data isn't accessible, but after second visit it is accessible for rendering' error in React-Redux

---------------------------------------------------------------------Working Project available at codepen.io: https://codesandbox.io/embed/happy-tharp-slvf5 --------------------------------------------...
0
votes
0answers
14 views

I need my background to scroll up when you scroll React-Pose

I am working with React and React Pose, my goal is that the scroll bar does not appear, which I currently have. But when you scroll it is to say "onScroll" or something like that, the background ...
0
votes
1answer
28 views

How do I prevent the Page from scrolling to top when queries are added to the URL?

I'm using queries to either open or close a collapse. The queries are important since they include data that I need later on. So basically the code determines whether the queries exist or not and then ...
0
votes
0answers
9 views

Emotion-js — Usage with strict content security policy (inline styles) [on hold]

Our ReactJS project makes use of Emotion, specifically: - emotion/core - emotion/styled - emotion-theming We are looking to implement a tighter content security policy that forbids inline styles, ...
0
votes
0answers
26 views

subcollections in firestore.ordered are rewritten

I have some problems with getting subcollections from firestore. I figure it out that i need to do multiple queries to get document with his subcollections. So I did something like this: ...
0
votes
1answer
26 views

Is it possible to pass two form name in on “formValueSelector” Redux form

I have created a forum section and want to use it with two different forms. My problem is can we pass two form name to "formValueSelector" I have two forms name a and b and curruntly I am able to ...
0
votes
0answers
24 views

Access persisted store when app is closed

Currently, I am using redux-persist to store data locally. I want to access persited store when app is closed like when a there is a new push notification. I have tried accessing store using ...
0
votes
0answers
26 views

React Redux Dispatch not updating store as expected

Currently have an implementation where i need to persist some data, then depending on the user action, this data needs to be cleared. I can clearly see that in the action, the data is cleared and ...
0
votes
2answers
37 views

How do you dispatch an action along with a DOM event?

I'm picking up working with react and redux, while handling state locally I am able to pass events along with onChange handlers so as to access the value with event.target.value and set them to state. ...
1
vote
0answers
34 views

Redux actions and reducers best practices [on hold]

I have 2 questions regarding "the best practices" in redux. The first one is if i have let's say boolean property in store ( or anything else that will have a few of values ). What do you think will ...
1
vote
1answer
12 views

Pass arguments in redux

I want to pass an argument in redux but I didn't found the way to do it. Here's my code: redux/actions export const next_page = (max_page) => { return { type: NEXT_PAGE, ...
0
votes
1answer
29 views

FlatList doesn't show title tags at all

I'm quite new at react-redux, and currently am trying to build some stack application that will simply be some type of menu that will have it's sections with titles and when pressing the title it will ...
1
vote
0answers
47 views

How to make mapStateToProps be called only when specific data is changed

I have created Component and connected it to the redux store with connect(). /* const state = { byId: { "1": {...}, "2": {...} }, allIds: ["1", "2"] } */ const Component = ({data, id}) ...
0
votes
0answers
12 views

Recommended way to modularize reducers in a NextJS application?

I have a Redux store that sits in a file named /web/reducers/index.js and looks like this: import { createStore } from 'redux'; const reducer = (state = { userData: '', sessID: '', ...
0
votes
0answers
40 views

How to act upon a redux action in a component without saving anything to the redux state?

I have the following structure: ComponentA -> renders a genome browser from a library (technically does not matter which one, but just for reference it is the following one: https://www.npmjs.com/...
0
votes
1answer
12 views

With applyMiddleware, dispatch not working

Hello I'm new in redux and I didn't see the problem, I look in other stackoverflow, with similar questions but didn't find mine. The problem is that dispatch is not working. src/redux/index.js ...
-1
votes
0answers
34 views

Unhandled Exception in Dispatch

I am getting TypeError randomly in multiple dispatch calls. I am using redux-thunk in my react app. What could be the reason for this error? TypeError: undefined is not iterable (cannot read ...
0
votes
0answers
17 views

Using existing user components (registration, log in, forgot password, etc) in React-redux/Express?

I'm starting with MERN stack, and I had recently begun to implement an authentication system (registration, login, log out, forgot password) for a website I'm building. I was thinking that instead ...
0
votes
2answers
41 views

Redux Error Actions must be plain objects. Use custom middleware for async actions

I am new to redux and I am stuck in an error, while dispatching an action I am getting error "Actions must be plain objects. Use custom middleware for async actions.", I have checked the flow but can'...
0
votes
1answer
33 views

The first page opens empty without loading the data

Problem: When my first page loads, the page is blank. What I did: I pass the data from Firebase to redux with the codes you see below. Then I do an if else check. (in return). Here's the problem. The ...
0
votes
2answers
34 views

Why are Redux actions called actions if they don't actually perform any action (I.E. dispatch)

Why are Redux actions called actions if they don't actually act upon the data and instead just return a payload? Is there any other use for an action other than to be dispatched, why don't actions ...
0
votes
1answer
19 views

Make template from saga: wrappe part of saga in function

I need make like saga template - wrapp part some of saga in function. I do it because many of my sagas have a similar structure and I try to decompose this code. Don't pay attention on details please,...
0
votes
2answers
59 views

React & Redux, Update state, Error: A state mutation was detected between dispatches

The problem I'm having is in my save data round trip. The error: browser.js:34 Uncaught (in promise) Invariant Violation: A state mutation was detected between dispatches, in the path profile.user....
0
votes
1answer
33 views

Refresh a page in a single page application

Let's say that you receive a link that takes you to a page from a single page application. You want to be able to see that page instantly (of course, if you are logged in). The issue is that the ...
2
votes
4answers
63 views

Dispatch an action from container

I'm new to react-redux and i want to dispatch an action from container to component. Here is my code : Container : import { connect } from 'react-redux'; import addCountryComponent from '../../...
0
votes
0answers
19 views

Desync with data in store react redux

I have flatlist with clickable components in it. After click on these components, I dispatch addPhotoToQueue. And than I call _addPhoto on click in flatlist. Let's say I count how many times these ...
0
votes
2answers
47 views

Called componentDidMount twice

I have a small react app. In App.js I have layout Sidenav and Content area. The side nav is shown on some page and hid from others. When I go to some components with sidenav, sidenav flag is set by ...
0
votes
0answers
18 views

How to manage nested dynamic forms in react-redux application

In my react application which uses redux, I want to create a form similar to the one shown below Here, child form fields dynamically change based on the inputs sent from parent component. And, on ...
0
votes
1answer
36 views

On dispatch Redux Actions must be plain objects. Use custom middleware for async actions

I am getting error "Actions must be plain objects. Use custom middleware for async actions." with below code class LoginForm extends React.Component { state = { username: '', password: '' }; ...
0
votes
1answer
21 views

React: Remove deduped data from local state from redux state using hooks

I have a react component (summarized code below). The react component should show an animation on screen when clicked and dispatches an action to redux server which is then stored remotely. When ...
1
vote
0answers
17 views

How do I access the data returned from my firestore database query?

I'm working on creating a function that queries my firestore database based on the name entered into an input box and returns some data. Now, my query works and logs to the console. The problem is ...