Skip to content

fix(types): type error when importing SVG file with React query#5587

Merged
chenjiahan merged 3 commits intoweb-infra-dev:mainfrom
GRAMMAC1:fix/svg-with-react-query-type-error
Jul 12, 2025
Merged

fix(types): type error when importing SVG file with React query#5587
chenjiahan merged 3 commits intoweb-infra-dev:mainfrom
GRAMMAC1:fix/svg-with-react-query-type-error

Conversation

@GRAMMAC1
Copy link
Copy Markdown
Contributor

Summary

Before

3fe95f57ce0bd3382afc64e4d2c26f4f

After

fdecce2522b6d9b56bb37d417fde7f14

type declaration should go in template project since rsbuild/core doesn't depend on React

Copilot AI review requested due to automatic review settings July 12, 2025 08:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@netlify
Copy link
Copy Markdown

netlify bot commented Jul 12, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit a9483cf
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/687260dc1ec2cb0008d6367f
😎 Deploy Preview https://deploy-preview-5587--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (🔴 down 3 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

import React from "react";
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export default ReactComponent;
export { ReactComponent };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to remove the named export, since this is not the default behavior of @rsbuild/plugin-svgr. When users set exportType: 'named', they can refer to this guide to update the type declaration.

Suggested change
export { ReactComponent };

Copy link
Copy Markdown
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ Nice!

@chenjiahan chenjiahan enabled auto-merge (squash) July 12, 2025 13:20
@chenjiahan chenjiahan changed the title fix(types): import svg file with react query get type error fix(types): type error when importing SVG file with React query Jul 12, 2025
@chenjiahan chenjiahan merged commit eee3173 into web-infra-dev:main Jul 12, 2025
13 checks passed
@GRAMMAC1 GRAMMAC1 deleted the fix/svg-with-react-query-type-error branch July 12, 2025 15:06
This was referenced Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants