Skip to content

Commit bd63618

Browse files
authored
Format SVG React snapshots as <svg> tag with props (facebook#5196)
* Format SVG React snapshots as <svg> tag with props * Keep output simpler
1 parent d849b62 commit bd63618

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

config/jest/fileTransform.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ module.exports = {
2121
return `module.exports = {
2222
__esModule: true,
2323
default: ${assetFilename},
24-
ReactComponent: () => ${assetFilename},
24+
ReactComponent: (props) => ({
25+
$$typeof: Symbol.for('react.element'),
26+
type: 'svg',
27+
ref: null,
28+
key: null,
29+
props: Object.assign({}, props, {
30+
children: ${assetFilename}
31+
})
32+
}),
2533
};`;
2634
}
2735

0 commit comments

Comments
 (0)