cost 67 ms
在 React Redux 中使用數組 TypeScript

[英]Working with Array TypeScript in React Redux

在 react-redux 中: API 文件,從數據庫返回數據: 切片文件,調用異步 function 並將有效負載設置為 varibale- 練習: 在帶有箭頭的行,我在控制台調試器 (f12) 中得到了這個: 我如何訪問其中的數據? ...

在 Redux 中嘗試使用非異步代碼時出現“Actions must be plain objects”錯誤

[英]Getting a 'Actions must be plain objects' error when trying to work with non-async code in Redux

我使用來自 Redux 站點的這些文檔為我的 Redux state 管理創建了一個基本設置: https://redux.js.org/usage/usage-with-typescript 。 我的基本設置如下,基本上是從上面鏈接的 Redux 文檔復制而來的: 商店.ts storeHook ...

無法將多個減速器與 combineReducers 一起使用,在 state 上收到未知屬性警告

[英]Can't use multiple reducers with combineReducers, getting an unknown property warning on state

我的商店設置如下: 登錄縮減器/切片如下所示: 計數器減速器/切片如下所示: 現在的問題是我無法通過這種方式訪問這兩個減速器的值,這應該是正確的方式(也根據 Redux Devtools): 做這樣的事情: ...返回undefined ,但嘗試執行state.counter.counterVal ...

錯誤:無法讀取 react-redux 中未定義的屬性

[英]Error: cannot read properties of undefined in react-redux

我正在嘗試遍歷電影數組中的每一部電影並渲染它。 有 4 個部分 Trending、NewDisney、Originals、Recommended。 電影的數據存儲在 firestore 中,我正在從那里檢索它。 這是代碼(刪除了所有樣式以使此處的代碼簡短) movieSlice.js 文件 Re ...

想了解react & redux

[英]Want to know about react & redux

React 和 redux 之間的基本區別是什么? 反應和 redux 是一樣的嗎? 為什么我們應該使用 redux? 最后為什么叫react-redux呢? 我想知道這一點,我只是混淆了這兩者。 ...

如何將 Next-Redux-Wrapper Store Provider 移動到布局組件?

[英]How to Move Next-Redux-Wrapper Store Provider to Layout Component?

你能幫我把 next-redux-wrapper store provider 移到布局組件中嗎? 我當前的代碼遵循 next-redux-wrapper office 文檔並且工作正常,但我想將商店提供程序移動到布局組件中,以防不需要 Redux 商店提供程序,因為它可能只是一個普通頁面。 當我 ...

如何從 react-redux 持久存儲中讀取和呈現數據

[英]How to read and render data from a react-redux persisted store

我正在嘗試將 React 存儲中的數據 output 放入組件中。 當頁面重新加載時,我正在使用 redux-persist 來維護整個站點的數據。 但是,我無法弄清楚如何將數據呈現到頁面上。 我嘗試在組件上使用來自 react-redux 的 { useSelector } 掛鈎,但這並沒有將數據 ...

Redux 工具包查詢-中間件路徑

[英]Redux Toolkit Query - Middleware path

我們正在與 redux 合作,網站上有多個應用程序。 我們的店長這樣 因此,商店根據各個應用程序進行划分。 但是當我想在應用程序中使用中間件時,這就成了問題。 因為app的key注入了store,store告訴我中間件沒有注冊。 中間件認為它可以訪問它:store.planningData 但正確的 ...

將數據從一個組件發送到一個切片並接收一個未定義的參數,即使在組件中它被發送得很好

[英]Sending data from a component to a slice and receiving one parameter as undefined even though in the component it is being sent just fine

我是 redux 工具包的新手。 我有一個登錄組件,我從那里向用戶切片發送 email 和密碼。 從那里我通過 axios 發出發帖請求。問題是我收到 email 但密碼未定義。 即使當我在組件中進行控制台登錄時,我也可以看到密碼是正確的。 我在 userSlice 的 loginUser func ...

state 在減速器更新 state 之前正在更新

[英]state are being updated before reducer is update the state

我正在使用 userReducer 在整個應用程序中管理用戶 state,但是在使用 reducer 更新 state 時,state 是在 reducer 能夠更新它之前更新的。 檢查在這里您可以看到之前的 state 變量已更新為有效負載中的新值。 商店.js rootReducer.js ...

難以在 redux-react 中顯示 API 響應

[英]difficulty displaying API response in redux-react

暈伙計們,所以我第一次使用 redux-react 並且我從 api 獲取數據,但是我在瀏覽器中顯示它們時遇到問題,任何人都可以幫忙,下面是我的代碼示例 ##切片文件 index.js 文件 所以當我控制台 API res 時,我在我的控制台中看到它,但是當我嘗試使用 useState 保存在變量 ...

在 React 項目上工作並在 TS 上出錯

[英]Working on a React project and getting error on TS

我正在做一個反應項目,我是 TS 的新手。 下面是我的代碼 - INITIAL_DATA 看起來像這樣 - 我正在這樣設置我的 setRows - 我在這里收到 TS 錯誤 - 不知道我在這里錯過了什么。 ...

訪問第三方iframe的redux store

[英]Access a third party's iframe's redux store

作為我正在進行的項目的一部分,我已經集成了來自第三方服務的 iframe。 這個 iframe 在它的任務完成時發送一條消息,但是消息中沒有數據,只是一條成功消息。 在控制台中,iframe 不斷記錄其 redux state,其中有很多我想要的好信息。 我還可以使用 redux 開發人員工具查看 ...

在 React Native 的滾動視圖上樣式不完美

[英]Style not perfect on scroller view in react native

代碼: 應用程序.js 卡薩.js 這是完整的代碼這是 output 我要我的 output 我正在嘗試做,但風格並不完美。 如果活動索引點寬度與我上面給出的非活動索引不同,我想這樣 output 當我嘗試增加活動索引寬度但所有索引點寬度都增加時當我嘗試減小寬度但所有索引寬度都減少時我該怎么做我的 ...

Redux - 當前處理商店中的日期類型

[英]Redux - handling date types in store currectly

在我們正在進行的項目中,我們有一個包含日期的通用界面。 當我們將 redux 添加到項目中時,我們遇到了一個問題,當我們在內部存儲包含日期的對象時收到警告A non serialized value was detected in the state... 所以我們更新了我們的代碼,在 reduce ...

如何使用 Typescript 不可變地更新 Redux state 數組

[英]How can I update Redux state array immutably using Typescript

我正在嘗試通過做一些像 Todo-List 應用程序這樣簡單的事情來學習 Typescript。 問題是我無法在我創建的切片中更新 Redux state 數組。(或者更像是我不知道該怎么做) 這是我的主要組件Todolist.tsx : 這是我的切片組件todoSlice.ts : 我從谷歌嘗試了 ...


 
粵ICP備18138465號  © 2020-2025 STACKOOM.COM