小编use*_*580的帖子

Redux 工具包 RTK 查询突变未获取返回数据

createApi您好,我最近学习了带有 rtk 查询工具的新 React 工具包,并且我正在尝试使用rtk 包中的工具将登录系统放在一起。

After giving it a test on the login button pressed, I see the network request going through without any issue(status code 200), and I get a response object providing user, token, however, when I try to get the returning data using useLoginMutation I get an undefined value.

below is the code for my endpoint which is injected in a base api:

export const apiLogin = theiaBaseApi.injectEndpoints({
  endpoints: (build) => ({
    loginUser: …
Run Code Online (Sandbox Code Playgroud)

reactjs react-redux react-hooks redux-toolkit rtk-query

7
推荐指数
1
解决办法
1万
查看次数