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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fallback title is not working #943
Comments
I tried this out in the Playground and noticed that the resultant TSX doesn't consider
import * as React from "react"
import { SVGProps } from "react"
interface SVGRProps {
title?: string;
titleId?: string;
}
const SvgComponent = ({
title,
titleId,
...props
}: SVGProps<SVGSVGElement> & SVGRProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={48}
height={1}
title="abc"
aria-labelledby={titleId}
{...props}
>
{title === undefined ? (
<title id={titleId}>{"Rectangle 5"}</title>
) : title ? (
<title id={titleId}>{title}</title>
) : null}
<path fill="currentColor" fillRule="evenodd" d="M0 0h48v1H0z" />
</svg>
)
export default SvgComponent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
馃悰 Bug Report
The documentation says that
But, setting
titleProp: true
in Next.js webpack doesn't add title even if the SVG itself has a title element in it.To Reproduce
<title>
element in itimport SVG from './../abc.svg?svgr
<ReactSvgImport />
Expected behavior
The resultant SVG in DOM should fallback to the existing title element from the root SVG
The text was updated successfully, but these errors were encountered: