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

No ?raw types in react.d.ts #237

Open
5 tasks done
SpeedySH opened this issue Sep 19, 2022 · 1 comment
Open
5 tasks done

No ?raw types in react.d.ts #237

SpeedySH opened this issue Sep 19, 2022 · 1 comment

Comments

@SpeedySH
Copy link

Describe the bug

declare module '~icons/*' {
  import type React from 'react';
  import type { SVGProps } from 'react';
  const component: (props: SVGProps<SVGSVGElement>) => React.ReactElement;
  export default component;
}

if use types just from the library, i can't use ?raw query, because ts, based on provided d.ts think this is component,

MB I'm missing sampling, but now i need to write custom types instead of Plug'N'Play.

Should i make PR about fix this stuff?

Reproduction

https://codesandbox.io/s/proud-river-hcuf9o?file=/src/App.tsx

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 21.70 GB / 31.92 GB
  Binaries:
    Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.17.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (105.0.1343.42)
    Internet Explorer: 11.0.22000.120

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@stramel
Copy link
Contributor

stramel commented Oct 13, 2022

Seems like this is likely limited by microsoft/TypeScript#38638

*?raw could be added but it would not match anything past the ?raw

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