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

feat(plugin-svgr): support for react query #1783

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Mar 11, 2024

Summary

Add support for ?react query to transform SVG into React component.

import Component from './small.svg?react';

function App() {
  return (
      <Component />
  );
}

This will become the recommended way to use SVGR, because:

  • No longer depend on the deprecated url-loader.
  • No longer rely on Rspack's issuer, which is inaccurate in some cases.
  • Better for tree shaking, avoid duplicated code.
  • Align with the vite-plugin-svgr usage.

Related Links

Checklist

  • Tests updated.
  • Documentation updated.

Copy link

netlify bot commented Mar 11, 2024

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit e66fe84
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/65eea2072ea5b50008a57b3f
😎 Deploy Preview https://deploy-preview-1783--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@chenjiahan chenjiahan requested a review from 9aoy March 11, 2024 06:33
@chenjiahan chenjiahan changed the title feat(plugin-svgr): support for ?react query feat(plugin-svgr): support for react query Mar 11, 2024
@chenjiahan chenjiahan merged commit 6683ffb into main Mar 11, 2024
15 checks passed
@chenjiahan chenjiahan deleted the svgr_query_react_0311 branch March 11, 2024 06:39
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.

2 participants