<!-- Love SVGR? Please consider supporting our collective: ๐ https://opencollective.com/svgr/donate --> ## ๐ Bug Report I'm trying to move the `ref` part from `<svg>` to a different part in my own template. But, it seems I can't do this when I have `ref: true` in the settings ## To Reproduce ```tsx // transform config { typescript: true, expandProps: false, memo: true, plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx', '@svgr/plugin-prettier'], svgoConfig, template: customTemplateWithWrapper, ref: true, jsx: { babelConfig: { plugins: [ // this plugin will remove "ref" attribute from "svg" tag [ '@svgr/babel-plugin-remove-jsx-attribute', { elements: ['svg'], attributes: ['ref'], }, ], ], }, }, } ``` ## Expected behavior `ref` attirbute in `<svg>` opening element should be removed. ---- ## Things I've tried: I can add the `ref` attribute to the element I want through a custom template. However, I can't delete `ref` from the `<svg>`. 1. Deleting `ref` within the custom template: It's impossible because the addition of `ref` takes place after the custom template has been processed. 2. Using the babelConfig option of `plugin-jsx`: This method does not allow the deletion of the `ref` attr. I'm working around to copy the bunch of code from the svgr repo and make the custom template more complex, but it doesn't seem like a good way. ## System info ```bash ## System: - OS: macOS 13.3.1 - CPU: (8) arm64 Apple M1 - Memory: 600.44 MB / 16.00 GB - Shell: 5.9 - /bin/zsh ## Binaries: - Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node - Yarn: 3.2.2 - ~/.yarn/bin/yarn - npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm ```
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by golee and has received 0 comments.