I'm trying to import svg file in NEXT.js using babel-plugin-inline-react-svg.
Followed all instructions and it works fine.
// .babelrc
{
"presets": ["next/babel"],
"plugins": [
["styled-components", { "ssr": true }],
"inline-react-svg"
]
}
// image.tsx
import styled from 'styled-components';
import BackgroundImage from '../public/assets/img.svg';
export const WhyChooseUsSection = () => {
return <>
<div className="background">
<BackgroundImage/>
</div>
<style jsx>{`
div {
position: relative;
width: 100%;
}
`}</style>
</>
}
// next.config.js
const withImages = require('next-images')
module.exports = withImages()
But it occurs warning.
Warning: Invalid attribute name: `'data-name'`
Is this Because of Typescript? How can I fix it?