Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript issue Property N does not exist on type IntrinsicAttributes #111

Open
inomn opened this issue Feb 28, 2024 · 1 comment
Open

Comments

@inomn
Copy link

inomn commented Feb 28, 2024

Hi! Thanks for the plugin. It works fine, but with the new version I'm getting typing errors

svgr({ include: '**/*.svg' }),
import Logo from './logo.svg';
Screenshot 2024-02-28 at 11 30 36

root tsconfig compilerOptions

"types": ["vite/client", "vitest/globals", "vite-plugin-svgr/client", "node"],

src/vite-env.d.ts, 1st line

/// <reference types="vite-plugin-svgr/client" />

Whats I'm doing wrong?

Thanks.

@inomn
Copy link
Author

inomn commented Mar 7, 2024

workaround i use rn:

declare module '*.svg' {
  import { HTMLAttributes } from 'react';

  export default React.Component<HTMLAttributes<HTMLDivElement>>;
}

allows you to

import Logo from './logo.svg';

and supports attributes

<Logo className={styles.logo} style={{ width: '20px ' }} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant