react-redux

    0熱度

    1回答

    我正在嘗試基於Dan Abramov here的建議來實現redux重置狀態操作。我設置我的減速器和存儲,像這樣: Index.js: import {applyMiddleware,createStore} from 'redux'; import combineReducers from './reducers/index'; import {wrapStore,alias} from '

    0熱度

    1回答

    我在行動的方法,它與服務器進行交互,並由於方式它的成立: function generateDoc(specs) { // Gen start ! InterfaceCard.setState({ showhide: true }); // loop : const promises = []; specs.forEach((spec) => {

    0熱度

    2回答

    我遇到了具有某些必需propTypes的組件的問題。 我得到的錯誤是: Warning: Failed prop type: The prop `firstname` is marked as required in `UserHeader`, but its value is `undefined`. in UserHeader (at App.js:32) in App (created

    0熱度

    1回答

    我正在嘗試使用redux-form和react-native。當我使用redux-form作爲網絡應用程序時,我試圖做一些我所做的事情。我正在嘗試使用redux-form驗證表單,但我立即看到驗證,而不是觸發onBlur或重點更改。 這裏是我的代碼: import React, { Component } from 'react'; import PropTypes from 'prop-typ

    2熱度

    1回答

    我有一個陣營 - 終極版咚,從一個API服務器檢索類別,然後將它們添加到Redux的商店採取行動: (categoryActions.js) export const fetchCategories =() => dispatch => ( CategoryAPI.getCategories().then(categories => { for(const category of

    2熱度

    1回答

    我正在嘗試使用setState更改狀態,然後使用新狀態調用動作,但React在設置新狀態之前調度動作。我該如何等待新狀態,然後發出行動? addressInput = e => { this.setState({ address: e.target.value }); this.props.filterSearch(this.state.address) /

    0熱度

    2回答

    我在學習Redux。在文檔中,任務應用程序以AddToDo.js模塊作爲示例。這裏是我的問題後面的代碼。 import React from 'react' import { connect } from 'react-redux' import { addTodo } from '../actions' let AddTodo = ({ dispatch }) => { let

    0熱度

    2回答

    我有一個使得api調用的動作的函數。行動 index.js export const GET_QUERY_LIST='GET_QUERY_LIST'; export const loadData=()=>{ return(dispatch)=>{ axios({ method:'GET', url:Constants.URLConst+"/Qu

    1熱度

    2回答

    我有一個減速reducerA看起來像這樣 reducerA = { A: [], B: {}, C: {}, D: [], }; 我還有一個減速reducerB看起來像這樣 reducerB = { E: {}, } 我想什麼做的是關鍵合併reducerB到reducerA並獲得一些看起來像這樣的東西 reducerA = {

    2熱度

    3回答

    我有一個陣營組件 export class Login extends Component { ..omitted for clarity } export default connect(select, actions)(Login); 而且可以看出它連接到終極版,它工作得很好 我有終極版形式 export class ChangePassword extends Compo