redux

    1熱度

    1回答

    我正在使用react-boilerplate構建一個應用程序,人們可以在其中創建和編輯事件。這個樣板使用immutable.js,所以我想學習它。 當我將事件保存到數據庫時,數據庫將該事件作爲對象返回。 console.log(action.payload.event) 將打印 { color:"#000000", name:"my Event", _id:"59

    0熱度

    1回答

    所以我剛剛開始使用redux.I試圖從API獲取一些GIF。 我的目標是返回一個img urls數組,而不是整個響應數據。但是,如果我嘗試迭代並返回每個圖像,我的狀態仍然爲空。如果我使用返回整個響應的return action.payload.data.data;,那麼這可以工作,但我只想獲取img網址。 這裏是相應的減速器。 import _ from 'lodash'; export def

    1熱度

    2回答

    我有一個連接到存儲和顯示的子組件類似下面的組件: render() { return <div> <div className="userBox"> <ProfilePhoto userid={this.props.id} /> </div> <div className="nameTitleBox">

    1熱度

    1回答

    如何根據條件以正確的方式發送操作: 我做了以下操作,但出現語法錯誤。 const PrivateRoute = ({ component: Component, ...rest }) => { <Route {...rest} render={props => ( firebase.auth().onAuthStateChanged((user) => user

    0熱度

    1回答

    我有一個減速這是適當的Redux的狀態(假設allpeople-reducer.js)在我的終極版是resposible爲下篇狀態 { 1:{id:1, first_name: "Tony", last_name: "Stark", gender: "Male"} 2:{id:2,first_name: "Wonder", last_name: "Woman", gend

    0熱度

    1回答

    我收到以下錯誤,雖然我回一個根元素: Route.render():有效的做出反應元素(或null)必須返回。您可能返回了未定義的數組或其他一些無效的對象。 調度是不是一個函數 我的代碼: export var PrivateRoute = ({ component: Component, ...rest }) => { return ( <Route {...rest} re

    1熱度

    1回答

    我是(相當)新Immutable.js和Redux(和Angular2)並獲得標題中的錯誤(我得到一個錯誤爲setIn和getIn)。錯誤來自我的store.ts。這裏的短版本: import { Action as reduxAction, Reducer, combineReducers } from 'redux'; import { ActionActions } from './a

    1熱度

    1回答

    我嘗試在redux-persist v5中使用白名單。 我對堆棧溢出其次this answer,像下面 persistStore(store, { whitelist: ['messages'] }); 但是,我得到了錯誤傳遞給persistStore 無效選項: 「白名單」。您可能會錯誤地將persistConfig傳遞到persistStore,而它應該傳遞到persistReducer。

    0熱度

    1回答

    我試圖驗證我的路由是否正確設置。就像在我有一個特定的URI的時候,那麼相應的組件就會被加載。只是爲了防止我意外地迷路。 下面是一個示例連接頁: import React from 'react'; import {connect} from 'react-redux'; export const ConnectPage = (props) => { return <div>{pro

    -1熱度

    2回答

    我有一個Redux商店,包含9個case語句的reducer。其中六個案例涉及在狀態數組中填充數組,處理所述數組的排序,因此沒有自然的方式來拆分減速器,可以將減速器合併爲一個嗎?