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

How to preserve role from template? #961

Open
MangoMarcus opened this issue May 14, 2024 · 0 comments
Open

How to preserve role from template? #961

MangoMarcus opened this issue May 14, 2024 · 0 comments

Comments

@MangoMarcus
Copy link

I'm having trouble preventing the role attribute being removed from my .svg templates. I need some to be img and some to be presentation.

I've not sure if the problem is with svgr or svgo, I've tried keepRoleAttr but not joy:

svgoConfig: {
  plugins: [
    {
      name: 'removeUnknownsAndDefaults',
      params: {
        keepRoleAttr: true,
      },
    }
  ],
},

I've also tried using svgProps with no joy, I'm guessing it overrides what's in the template to undefined.

svgProps: {
  role: '{undefined}',
},

Is there a way to just use what's in the template?

I'm using @svgr/webpack v8.1.0 with nextjs v14.2.2.

Thanks

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