首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >类型错误:键入“{ color: string;loading: true;css: string;size: number;}”不能指定键入“IntrinsicAttributes&LoaderSizeMarginProps”

类型错误:键入“{ color: string;loading: true;css: string;size: number;}”不能指定键入“IntrinsicAttributes&LoaderSizeMarginProps”
EN

Stack Overflow用户
提问于 2022-09-24 16:01:26
回答 1查看 35关注 0票数 0

当我试图构建该项目时,我得到了以下错误:

代码语言:javascript
复制
$ yarn run build
yarn run v1.22.19
$ next build
info  - Loaded env from D:\folder_1\my_Project\client\.env.local
info  - Linting and checking validity of types .Failed to compile.

./components/profile/mintingModal/LoadingState.tsx:28:49
Type error: Type '{ color: string; loading: true; css: string; size: number; }' 
is not assignable to type 'IntrinsicAttributes & LoaderSizeMarginProps'.
  Property 'css' does not exist on type 'IntrinsicAttributes & LoaderSizeMarginProps'.

  26 |     <div className={style.wrapper}>
  27 |       <div className={style.title}>Minting in progress...</div>
> 28 |       <GridLoader color={'#fff'} loading={true} css={subtitleStyle} size={30} />
     |                                                 ^
  29 |     </div>
  30 |   )
  31 | }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

这是错误出现在其中的LodaingState.tsx文件

代码语言:javascript
复制
import { GridLoader } from 'react-spinners'
import { css } from '@emotion/react'

const style = {
  wrapper: `h-[20rem] w-[35rem] text-white bg-[#15202b] rounded-3xl p-10 flex flex-col items-center justify-center`,
  title: `font-semibold text-xl mb-6`,
}

const cssOverride = css`
  display: block;
  margin: 0 auto;
  border-color: white;
`

const LoadingState = () => {
  return (
    <div className={style.wrapper}>
      <div className={style.title}>Minting in progress...</div>
      <GridLoader color={'#fff'} loading={true} css= {cssOverride} size={30} />
    </div>
  )
}

export default LoadingState
EN

回答 1

Stack Overflow用户

发布于 2022-09-24 16:16:48

我将文件重命名为LodaingState.js,而不是LodaingState.tsx,它起作用了;错误消失了,但不幸的是,我不明白为什么!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73838654

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档