Questions tagged [react-redux]

Official React bindings for Redux

0
votes
0answers
10 views

Does React batch props updates in some cases?

I'm curious whether React batches updates to props in some rare cases? There is no mention of this in the docs, but I couldn't come up with any other explanation of the following situation. I have an ...
0
votes
0answers
8 views

React Redux app displaying blank page after IIS deployment

I have successfully run npm run build and added my site to IIS pointing to the new build folder. When browsing the site, I get a blank page. If I edit the index.html generated in the build folder, ...
0
votes
2answers
30 views

Search in Redux store if specific string exists in messages array

I'm trying to use something like a contains() function in redux but apparently it doesn't exist. case types.FILTER_MESSAGES_BY_CONTENT: return { ...state, ...
2
votes
2answers
20 views

Same name of field in redux-form

I am working on a comment section and using redux-form for taking input. I have only one Field component for taking input. But when I type in the input box all the input boxes get filled with the same ...
1
vote
1answer
17 views

Using redux to initialize a global state then letting local component state take over

This is more of a state design/best practices question with react and redux. I have an app which handles three kinds of data (albums, posts, profiles) and renders them all in a single component (...
0
votes
0answers
12 views

Authentication failed in react native

I am pretty new to react native and I am using firebase to implement authentication in my app. However despite putting the correct email and password I am failing to log in. It is always showing ...
0
votes
0answers
24 views

How to properly use react-redux connect with typescript@3?

I'm trying to create type-safe HOC going with TypeScript and react-redux. hoc/with-is-visible-range.tsx import React from "react"; import { Subtract } from "utility-types"; import { connect } from "...
1
vote
1answer
15 views

React router v4 with redux not able to re-render component

I am having a difficulties with rendering the components when the new location is being pushed. using these versions: "react": "^16.5.2", "react-router-dom": "^4.3.1", "redux": "^4.0.0" Base.js &...
1
vote
1answer
30 views

Uncaught Error: You should not use <Switch> outside a <Router>, but Switch is inside

When I try to run my app, developer tool is giving me this error. I can't figure it out because I placed the Switch component within ConnectedRouter. Any ideas anyone? src.ca056580.js:28856 ...
0
votes
2answers
28 views

React & Redux: Dispatching action not working

I have a scenario where I am dispatching an action after an api call is successful. axios.get(url) .then(response => { console.log("RESPONDED", response, dispatch) const ...
0
votes
1answer
21 views

react Native request failed with 415

I am using react native and I want to send some document file to server using patch request. This is the form data which I am sending Below is the fetch code export const stepStageFour = (data,id) ...
0
votes
1answer
11 views

orderByChild() dispatch many times

I'm trying to make SectionList with data get from firebase. I used to create FlatList with the following code and it works perfect. firebase.database().ref(`/restaurantes/${currentUser.uid}/dishes`) ...
0
votes
1answer
23 views

React Ant Calendar remove month, year buttons

Need a help in Ant Calendar import { Calendar } from 'antd'; function onPanelChange(value, mode) { console.log(value, mode); } ReactDOM.render( <Calendar onPanelChange={onPanelChange} /&...
0
votes
0answers
35 views

Redux with React - changing state between reducers

I'm not sure the title of the question is even correctly stated. So, the idea is that I have separate reducers for list of users (that I get from a free service https://reqres.in/) and the ...
0
votes
1answer
38 views

How to get the latest value to a state from a redux store?

I am fairly new to Redux, I'm using the react-redux package and trying to implement a simple feature (although I know this can be handled via local state), where whatever you type in the input should ...
0
votes
1answer
21 views

How to change React Native Animated sequence timings on receiving props

I have a looping animation that I want the user to be able to change the timings of. Using a redux I have set it up so that the component being animated receives the new timings as props when the user ...
0
votes
0answers
10 views

connected-react-router does not render components inside connected component

I'm having issues with connected-react-router not rendering any route'd components. This is my component: import React from "react"; import { connect } from "react-redux"; import { Switch, Route, ...
1
vote
0answers
33 views

How to test componentDidUpdate()?

This is an example implmentation: export class Person extends Component { componentDidMount() { const { onLoadProfile, onLoadPolicy, person } = this.props onLoadProfile(person.profile.uri) ...
0
votes
3answers
16 views

React native Redux dispatch is not a function, dispatch is an instance of Object

When dispatch is called I get an error - 'dispatch is not a funcion ... dispatch is an instance of Object' I have connected mapDispatchToProps and I don't know how to fix this (I am new to react and ...
0
votes
0answers
14 views

How to reset filter values in react admin?

I have some filter component export const PostsFilter = (props) => ( <Filter {...props}> <TextInput label='Post ID' source='id' alwaysOn /> <TextInput label='User ID' ...
-2
votes
0answers
40 views

How implement componentDidUpdate on right way, to getting some data in realtime?

There is in the application "claims" and we are able to edit that claims. There is in edit mode form-option for changing date of claim 1. When you change date and click save: That entire form is ...
0
votes
2answers
40 views

React Native - How to store auth token and navigate to other screen after login?

I am a newbie in react native, I am creating one react native application with redux. I am only on the login page. Currently, I implemented redux successfully and getting response from API when login ...
4
votes
1answer
47 views

Do I need React.PureComponent when the component is `connect`ed to react-redux store?

They say we can improve the performance of React app by using React.PureComponent in some cases, because it shallow compares its props before updating the component. https://reactjs.org/docs/react-...
0
votes
0answers
22 views

Worker being called before Action (Redux) being executed

Trying to call api to fetch some data once the user sign-in and store in indexed db. But the worker code gets called before sign-in happens i.e., once the application starts it finishes its work. app-...
1
vote
1answer
24 views

React - Redux-Form Remote Submit

I am attempting to remotely submit a form using redux-forms. My question would be, how do I execute redux actions from a function outside the component. The equivalaent of saying: this.props....
0
votes
0answers
33 views

Changes are not reflected in UI in react

When a user like a post, then the count is incremented in ui. Bu when a user remove the like then count ui is not changing though it is changed in server.How to solve it? When a user like a post, then ...
0
votes
1answer
19 views

How to fix an “Could not find 'store'” error in React-Redux?

I'm trying to add React-Router to my application, but getting an error: Here is a code
1
vote
3answers
107 views

Redux Form error on submit empty search value query

I'm trying to take values from a Redux Form and pass them to an Action like this: /action/index.js export function getResult(values) { const search = values.searchText; const category = values....
1
vote
2answers
31 views

React-redux - state overwrites itself

I am using react-redux (for the first time). I have a component into which users put a 'startDate' and an 'endDate'. These should then be stored in the redux store, so that they persist. I have the ...
0
votes
2answers
28 views

react-redux connect should have side effects?

I have a component which need logged-in user data but in this component I'm not sure if user is logged in yet or not is it a bad practice to check existance data in mapStateToProps and redirect to ...
0
votes
2answers
43 views

Get total values

I can get my values thank you.
2
votes
1answer
115 views

How do I fix this React Native error:“java.lang.String cannot be cast to com.facebook.react.uimanager”?

I used the following segments of code to create a new button but I got the "java.lang.String cannot be cast to com.facebook.react.uimanager.AccessibilityDelegateUtil$AccessibilityRole" error. I did ...
-1
votes
2answers
49 views

Where is this function argument coming from? [on hold]

In the below code, I can't figure out where the {getFirebase} argument is coming from that is being passed in to the line that reads... return (dispatch, getState, {getFirebase}) => { If you can'...
2
votes
1answer
31 views

React - Redux | Unhandled Rejection (TypeError): Cannot read property 'data' of undefined

Everything is fine until login > dispatch > payload: err.response.data. Then gives an error: Unhandled Rejection (TypeError): Cannot read property 'data' of undefined I've checked many sources but I ...
1
vote
1answer
19 views

How to implement Firebase authentication with React Redux?

I am using Firebase to handle my authentication through Facebook or google. The thing I really do not understand is the reason why is my store not updated. Below is an example of my code: import { ...
0
votes
2answers
31 views

Redux - call action from a function

I'm trying to call a redux action from a function. The component that I'm calling the function from is already connected to the store. However, it doesn't work if I pass the action such as: function ...
-5
votes
1answer
26 views

Build simple Site like (Medium.com) on Node.js and React.js

Which technologies are using on this.and how working NODE js And REACT js working?
0
votes
0answers
10 views

React: get document data from redux-firestore

I'm trying to pass to the component Post the User attributes (displayName, Email ecc...) but it say to me that is Undefined. In the Post I had a "post" object with the attr post.authorid, when i try ...
0
votes
0answers
23 views

How do i get withRouter work in my child component which is not configured as route

I just want to perform some usual operation. When I click on the logo of my site it should take me to the Main Page. Whether I am on a third page of the website, after clicking on the logo I should be ...
0
votes
0answers
37 views

Why doesn't my component render when I redirect

I'm conditionally rendering a redirect like this render() { if (condition) { return(<someComponent />) } else { return ( <BrowserRouter> <Redirect push to="/...
0
votes
1answer
21 views

React Native Emptying Props

I have a screen that includes Signin and Signup buttons. When user taps SigninButton, I send him to login screen. In the login screen, there are two text inputs which receive email and password from ...
0
votes
1answer
44 views

this.props is not a function with redux connect

I am getting the error that this.props.onAddTrip on components/NewTrip.jsx is not a function and I have been debugging this for a few days. Any help is appreciated! I have included the code to my ...
0
votes
0answers
9 views

Jest Redux, mock exported dispatch

I have a react-native project that uses redux and connect (react-redux) and I want to text that my components are calling the right actions when mounted. The thing is I did not follow the traditional ...
1
vote
0answers
19 views

upgrading from rxjs v5.5.6 to rxjs v6.3.3 with rxjs-compat v6.3.3

So i just recently began updating the version of rxjs on my react project, following the instructions given here: https://rxjs-dev.firebaseapp.com/guide/v6/migration according to the instructions ...
0
votes
0answers
42 views

Action called in ComponentDidMount is getting called infinitely

I am new to the react js , So here I am calling a action in the componentDidMout and then its going in an infinite loop, again and again calling same action. Routing -> render() { return ( ...
0
votes
2answers
28 views

How to call a function of a class from another file in React Native?

This is my initial screen: LoginScreen.js import { Toast } from 'native-base' class LoginScreen extends Component { showError(error) { Toast.show({ text: error }) } ..... } ...
0
votes
2answers
28 views

React AntD Forms Error Element type is invalid: expected a string (for built-in components)

I am running into this error when trying to utilize AntD forms: Element type is invalid: expected a string (for built-in components) I have done research and a lot of topics discuss how the ...
0
votes
1answer
11 views

How to display modal on the react google map without marker?

Please help me! I am trying to display new modal when clicking on the react google map. By the way i don't know that how to display new modal on the react google map. I am looking forward to hearing ...
1
vote
1answer
14 views

Always call component did update on construct?

I've been finding myself writing code that looks like this: class MyComponent extends Component { constructor(props) { super(props); const {foo, bar, fetchFoo, fetchBar} = props; ...
0
votes
2answers
30 views

React/Redux - Pass variable to action

I'm new to Redux and working on a project using the Spotify API. I'm sending API calls and retrieving data about the currently playing song. I have a separate Redux action that is attempting to grab ...