困难ReactRedux
0 1

Redux如何添加新的中间件?

【概念释义】

添加 Redux 自定义中间件:实现 (store) => (next) => (action) => { ... return next(action); },通过 applyMiddleware 或 RTK configureStore({ middleware })concat 注入。多个中间件组成洋葱链,顺序影响行为。

【基础使用】

jsx
const crashReporter = (store) => (next) => (action) => {
  try {
    return next(action);
  } catch (err) {

登录查看完整 1085

回答讨论

暂无讨论,登录后可抢先发言

本题库更多题目(50)