redux

Store not updating in IE11 (react redux)

馋奶兔 提交于 2019-12-24 06:30:09
问题 in IE 11 I can't update my store. First time it add data, but next time, when I try update it not working. I try use polyfill import Immutable from 'immutable' const objectAssign = require('object-assign'); const initialUserState = { } ; const BackupReducer = function(state = initialUserState, action) { //console.log('actiondata in reducer:' + action.data + action.type); switch(action.type) { case 'GET_BACK_LIST': return objectAssign({}, state, { backups: action.data }); break; but it not

Store not updating in IE11 (react redux)

霸气de小男生 提交于 2019-12-24 06:29:28
问题 in IE 11 I can't update my store. First time it add data, but next time, when I try update it not working. I try use polyfill import Immutable from 'immutable' const objectAssign = require('object-assign'); const initialUserState = { } ; const BackupReducer = function(state = initialUserState, action) { //console.log('actiondata in reducer:' + action.data + action.type); switch(action.type) { case 'GET_BACK_LIST': return objectAssign({}, state, { backups: action.data }); break; but it not

Redux Form in react native, onChangeText with Value not work correcly

泪湿孤枕 提交于 2019-12-24 05:59:50
问题 I use TextInput with onChangeText and Value, Value for use initialValues, and onChangeText for change this value. When I only use onChangeText without Value, it works correcly, but when I use onChangeText and Value it doen't works correcly. I upload image that show the error. I want write "Hi, How are you?" You can see the error in the following link: https://i.stack.imgur.com/MiVNn.gif My code: import { Field, reduxForm } from 'redux-form'; import { connect } from 'react-redux'; const

Loading images from Firebase Realtime Database + Storage

我与影子孤独终老i 提交于 2019-12-24 05:57:52
问题 I'm creating something like an image gallery of cars using create-react-app in Firebase documentation (react+redux+firebase). Images information are stored in Firebase Realtime Database, but the actual image files are stored in Firebase Storage. In componentWillMount, I called an action creator to fetch those images: this.props.fetchCars(); In the action creator, this function executes: export function fetchCars() { return (dispatch, getState) => { carsRef.on('value', snapshot => { dispatch({

My NgRx effects not working, nothing happend

北城以北 提交于 2019-12-24 05:15:05
问题 I have problem with my NgRx effects. The application correctly adds to the store, unfortunately my effects with the request are not performed, i.e. at the time of launching the addition of a new car, add it to the store and that's it. The problem is that there are no console logs from my effects, no http error because of the wrong url, nothing at all. My app code: Reducer import { Action } from '@ngrx/store'; import * as CarActions from './car.actions'; import { Car } from 'src/models/car

React Native redux reducers best way to push array

一曲冷凌霜 提交于 2019-12-24 03:38:09
问题 I have the following state and reducer but it's not pushing in the new array object. const initialState = { photos: [], selectedPhoto:{}, photosTeamId:'', photosProjectId:'' }; case actionTypes.PHOTOS_UPDATE: return Object.assign({}, state, { photos:action.data.photos, photosTeamId:action.data.photosTeamId, photosProjectId:action.data.photosProjectId }) photos is not getting pushed but overwritten 回答1: Here's a more cleaner way using javascript spread syntax : const initialState = { photos: [

Executing a function after the action finished its working

点点圈 提交于 2019-12-24 03:36:11
问题 Hey guys started out Redux today so was building a very basic Project of Incrementing/Decrementing the number on clicking the Increment/Decrement button. Here is a small code for it !Please have a look Actions-creater file export const increment=(num)=>{ return { type:'increment', payload:num } } reducers file const change=(change=0,action)=>{ if(action.type==='increment'){ return action.payload+1 } return change } export default combineReducers({ change }) Increment.js class Increment

Redux-saga get data from action returns patternOrChannel is undefined

帅比萌擦擦* 提交于 2019-12-24 03:21:56
问题 I need to send dynamic data from my screen to action/reducer and fetch data from API with that data, but when i yield in my rootSaga i'll get an error like this: uncaught at check take(patternOrChannel): patternOrChannel is undefined uncaught at rootSaga at rootSaga at takeEvery Error: take(patternOrChannel): patternOrChannel is undefined Screen code: import { checkUserLoginStatus, userSignin } from '../actions/user'; class PreCheckout extends PureComponent { handleLogin = () => { this.props

React: How to update one component, when something happens on another component

送分小仙女□ 提交于 2019-12-24 03:16:49
问题 I have an application with a table, the table has a checkbox to set a Tenant as Active, this variable is a global variable that affects what the user does in other screens of the application. On the top right of the application, I have another component called ActiveTenant, which basically shows in which tenant the user is working at the moment. The code of the table component is like this: import React, { Component } from 'react'; import { Table, Radio} from 'antd'; import { adalApiFetch }

React & Jest testing: nested component connected to Redux gives Invariant Violation error

大憨熊 提交于 2019-12-24 03:15:30
问题 So I have a component that I import to do some testing with Jest. class MyComponent extends Component { render() { return ( <div> <OtherComponent /> </div> ); } } export { MyComponent }; where the other component is defined as: class OtherComponent extends Component { ... } export default connect(...)(OtherComponent); My test is as follows: import React from 'react'; import { shallow } from 'enzyme'; import { MyComponent } from '../../components/MyComponent'; // ... Just the fact that inside