Search code examples
reactjsredux-toolkitrtk-query

Redux Toolkit useMutation hook data sharing between multiple component


I was building a react app where I am using redux-toolkit for state management where I am using useMutation hook to conditionally trigger post requests but I am not able to consume the data from this hook among multiple component. After searching a bit I stumble upon this https://github.com/reduxjs/redux-toolkit/pull/1477. Is fixedCacheKey ready to be used now for useMutation hook since its throwing error when I am using in code currently.

My redux-toolkit version is 1.6.2


Solution

  • It is available in the recently released Redux Toolkit version 1.7 beta.

    https://github.com/reduxjs/redux-toolkit/releases/