最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

redux 状态可以不同步吗?

网站源码admin29浏览0评论

redux 状态可以不同步吗?

redux 状态可以不同步吗?

function Sorter({ redux_state_obj, set }) {
  const handle_click = () => {
    const new_state = JSON.parse(JSON.stringify(redux_state_obj))

    // update redux_state_obj based on its current state

    set(new_state)
  }

  return  <div onClick={handle_click}>button</div>
}

假设我点击并且

Sorter
重复极快的两次。
redux_state_obj
是否会在第二次点击时过时,即它在第一次点击更新之前使用
redux_state_obj

回答如下:

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论