Hot to get state from Redux RTK mutation in another component

Viewed 795

Hey i'm new to RTK toolkit and just trying to access state from isolated component to store state from mutation, so i can skip passing them to that component.

I can see the result from mutation in redux store behind the cashe key, but how to access the store data from isolated component?

I read the documentation at least twice and saw that if it's QUERY i can pass useGet** hook with the same args and could get the result. But my case is to access result from mutation (POST query).

Just in case i can create selector to the whole state:

export const selectSubmitStatus = (state) => state[createApi.reducerPath]; and possibly manual filter current item, but it could be easier to access mutation submitState with selector and passing cashe key or?

Simmilar problem here described

0 Answers
Related