1

我正在尝试将 RTL 支持添加到我的 React 应用程序中。

由于我在调用 API 时使用了一个加载栏(这个:react-redux-loading-bar),所以过程很长......我还想在 RTL 处于活动状态时将其更改为从右到左。

我首先尝试使用 Material UI进度条,但我没有找到一个很好的示例/想法来说明如何将它添加到我的工作流程中,这只是:React / Redux。这也可以解决问题。

有什么解决方案可以实现吗?

我的 Redux 操作如下所示:

export const rdxDoGetCategories = () => {
  return async dispatch => {
    try {
      showLoadingBar(dispatch); // Show loading bar
      dispatch(rdxGetCategories(await getCategories())); // Call to the API then save it into the store
    } catch (error) {
      console.warn(error);
    } finally {
      hideLoadingBar(dispatch); // Hide loading bar
    }
  };
};

谢谢你的时间。

4

0 回答 0