English 中文(简体)
如何处理使用 取决于吉大港山区应对措施的影响
原标题:How to deal with useEffect when it depends on HTTP response

在《土著口供》中,我有一个部分显示项目清单。 当用户增加一个新项目时,吉大港山区开发协会请求将这一新项目寄给背后方,后者将其储存在数据库中。 虽然这种情况发生,但前端正将用户重新定位到项目清单中,这些项目与后台相隔。

在项目清单构成部分中,我有一份<编码>不适用<>编码>。

  useEffect(() => {
    fetchItems(auth.userId, auth.accessToken, axiosPrivate)
  }, [fetchItems])

<代码>fetchItems是一份红色行动,负责吉大港山区开发计划要求各项目封顶。

但当用户到名单上时,新项目就没有。 如果用户重载该仪器,则该机在座。 我猜测,它必须用时间更新大吉斯过渡行政当局要求的数据。

我在我的裁员中这样做:

case ADD_ITEM_SUCCESS:
    return {
        ...state,
        isLoading: false
    };

我试图利用<代码>is Loading的信息来控制这种行为,但不能这样做。

我应该做些什么来保证最新数据?

问题回答

暂无回答




相关问题
Async Storage can t retrive data

I m currently creating an app using react native and async storage, but there s a problem when I add the new data, it can t show it on the screen until I ctrl+s the code file, but I want that when I ...

React JS How to submit a form and THEN navigate to new page?

I want to preface this by saying I am completely brand new to web development and am trying to add features to legacy code (and honestly I am not sure what the entire tech stack is)! Thank you for any ...

React Hook Form Error on custom Input component

I am having a problem when I use react hook form + zod in my application, in short the inputs never change value and I get the following error in the console: Warning: Function components cannot be ...

HandleClick not being recognized as a prop

I m trying to get my menu to show when I click the sidebar, but I m getting an error "react-dom.development.js:86 Warning: React does not recognize the handleClick prop on a DOM " import { ...

Is there an equivalent to localStorage in React Native?

I d like to implement the equivalent to the javascript localStorage in my React Native app. But I m unsure how to set. To function how I want it to, I would like the localStorage to be stored every ...

热门标签