使用 React-loading 包并工作但无法将其居中

Used React-loading package and working but not able to center it

我正在设置一个从 Api 获取数据时旋转的反应加载程序。它正在工作并显示,但我无法将它放在中间

我尝试为组件提供一个类名并在 css 中访问它以进行更改但无济于事。

const ImageList = ({ image, isLoaded }) => {
  if (isLoaded) {
    return (

      <ReactLoading type="spin" color="blue" />

    );
  }
  const imgs = image.map(img => (
    <img
      key={img.id}
      src={img.urls.regular}
    />
  ));
  return (
    <div>
      {' '}
      {imgs}
      {' '}
    </div>
  );
};

export default ImageList;

它本来是要在中间渲染的,但它不是低于栏而是向左渲染

我不知道组件 ReactLoading 但如果您无法对其应用样式,请将其包装在 div 中并将样式设置为 div 包装器.