You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/babel-plugin-transform-svg-component/src/__snapshots__/index.test.js.snap
+70Lines changed: 70 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,17 @@ export default \\"logo.svg\\";
76
76
export {SvgComponentasComponent};"
77
77
`;
78
78
79
+
exports[`plugin javascript with "native" and "expandProps" option adds import from "react-native-svg" and adds props 1`] = `
80
+
"import * as React from \\"react\\";
81
+
import Svg from \\"react-native-svg\\";
82
+
83
+
function SvgComponent(props) {
84
+
return <Svg><g /></Svg>;
85
+
}
86
+
87
+
export default SvgComponent;"
88
+
`;
89
+
79
90
exports[`plugin javascript with "native" option adds import from "react-native-svg" 1`] = `
80
91
"import * as React from \\"react\\";
81
92
import Svg from \\"react-native-svg\\";
@@ -87,6 +98,30 @@ function SvgComponent() {
87
98
export default SvgComponent;"
88
99
`;
89
100
101
+
exports[`plugin javascript with "native", "ref" and "expandProps" option adds import from "react-native-svg" and adds props and adds ForwardRef component 1`] = `
exports[`plugin typescript with "native" and "expandProps" option adds import from "react-native-svg" and adds props 1`] = `
258
+
"import * as React from \\"react\\";
259
+
import Svg, {SvgProps} from \\"react-native-svg\\";
260
+
261
+
function SvgComponent(props: SvgProps) {
262
+
return <Svg><g /></Svg>;
263
+
}
264
+
265
+
export default SvgComponent;"
266
+
`;
267
+
222
268
exports[`plugin typescript with "native" option adds import from "react-native-svg" 1`] = `
223
269
"import * as React from \\"react\\";
224
270
import Svg from \\"react-native-svg\\";
@@ -230,6 +276,30 @@ function SvgComponent() {
230
276
export default SvgComponent;"
231
277
`;
232
278
279
+
exports[`plugin typescript with "native", "ref" and "expandProps" option adds import from "react-native-svg" and adds props and adds ForwardRef component 1`] = `
280
+
"import * as React from \\"react\\";
281
+
import Svg, {SvgProps} from \\"react-native-svg\\";
282
+
283
+
function SvgComponent(props: SvgProps, svgRef?: React.Ref<React.Component<SvgProps>>) {
0 commit comments