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

wildcard module declaration is ignored #231

Closed
mithodin opened this issue Dec 13, 2022 · 2 comments
Closed

wildcard module declaration is ignored #231

mithodin opened this issue Dec 13, 2022 · 2 comments

Comments

@mithodin
Copy link

I am using svgr to automatically create React components from svg files. To make typescript understand this, I have the following declaration file:

declare module '*.svg' {
    import { ReactElement, SVGProps } from 'react';
    const content: (props: SVGProps<SVGElement>) => ReactElement;
    export default content;
}

However, when I'm trying to create a type definition for an entry point that uses some svg imports, I'm getting a bunch of errors like

src/icons/index.ts(3,23): error TS2307: Cannot find module './Checkmark.svg' or its corresponding type declarations.

so the declaration seems to be ignored. Not sure if this is a bug or a feature request, but I'd like this to work :-)

@timocov
Copy link
Owner

timocov commented Dec 13, 2022

Sorry for redirect reply, but this is kinda duplicate of #227 (comment)

@timocov timocov closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2022
@timocov
Copy link
Owner

timocov commented Dec 13, 2022

I think it is worth to summarize ideas about that somewhere so I created a discussion where I tried to explain everything and provided ideas how to solve it - #232. Feel free to ask any questions there.

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

2 participants