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

Format SVG React snapshots as <svg> tag with props #5196

Merged
merged 2 commits into from
Oct 1, 2018
Merged

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Oct 1, 2018

Fixes the issue in #5147 (comment).

We used to just emit filename for SVG snapshots when imported as React components. But that's not super useful and we forgot to change it before the release.

This prints it as an SVG tag instead, with any props passed in. But we don't render the inside.

Before and after:

-     logo.svg
+     <svg
+       className="lol"
+     >
+       logo.svg
+     </svg>

Closes #5191.

@Timer Timer added this to the 2.0.0 milestone Oct 1, 2018
@gaearon gaearon merged commit 53e4c0a into master Oct 1, 2018
@Timer Timer deleted the svg-snap branch October 1, 2018 13:52
zmitry pushed a commit to zmitry/create-react-app that referenced this pull request Oct 2, 2018
* Format SVG React snapshots as <svg> tag with props

* Keep output simpler
@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants