withastro/language-tools

๐Ÿ› BUG: upgrade @astrojs/check from 0.3.2 to 0.3.3 astro check command throws error within React components

Closed this issue ยท 1 comments

Describe the Bug

after upgrade @astrojs/check from 0.3.2 to 0.3.3 if I run astro check it will throw error Property 'className' does not exist on type on each usage of native HTML elements with className inside React JSX attribute

example component that will throw

export function Title({
  children,
  inline,
}: PropsWithChildren<TitleProps>): ReactElement {
  return (
    <h6
      className={classNames(...THEME.primaryText, 'text-lg font-medium', {
        'inline-block': inline,
        'mb-0': inline,
      })}>
      {children}
    </h6>
  );
}

export interface TitleProps {
  inline?: boolean;
}

Steps to Reproduce

  1. npm init astro
  2. npx astro add react
  3. create a typescript react component and use 'className' attribute in it
  4. astro check throws an error

Duplicate of #727