@@ -9,8 +9,8 @@ export { default as File } from './File'
9
9
exports [` cli should not override config with cli defaults 1` ] = `
10
10
"import * as React from 'react'
11
11
const SvgFile = () => (
12
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" >
13
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
12
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } >
13
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
14
14
</svg >
15
15
)
16
16
export default SvgFile
@@ -32,8 +32,8 @@ exports[`cli should support --no-index 1`] = `
32
32
exports [` cli should support --prettier-config as file 1` ] = `
33
33
"import * as React from 'react'
34
34
const SvgFile = (props) => (
35
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
36
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
35
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
36
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
37
37
</svg >
38
38
)
39
39
export default SvgFile
@@ -44,8 +44,8 @@ export default SvgFile
44
44
exports [` cli should support --prettier-config as json 1` ] = `
45
45
"import * as React from 'react'
46
46
const SvgFile = (props) => (
47
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
48
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
47
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
48
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
49
49
</svg >
50
50
)
51
51
export default SvgFile
@@ -56,9 +56,9 @@ export default SvgFile
56
56
exports [` cli should support --svgo-config as file 1` ] = `
57
57
"import * as React from 'react'
58
58
const SvgFile = (props) => (
59
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
59
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
60
60
<title >{ ' Rectangle 5' } </title >
61
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
61
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
62
62
</svg >
63
63
)
64
64
export default SvgFile
@@ -69,9 +69,9 @@ export default SvgFile
69
69
exports [` cli should support --svgo-config as json 1` ] = `
70
70
"import * as React from 'react'
71
71
const SvgFile = (props) => (
72
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
72
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
73
73
<title >{ ' Rectangle 5' } </title >
74
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
74
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
75
75
</svg >
76
76
)
77
77
export default SvgFile
@@ -134,8 +134,8 @@ exports[`cli should support different filename cases with directory output: --fi
134
134
exports [` cli should support stdin filepath 1` ] = `
135
135
"import * as React from 'react'
136
136
const SvgFile = (props) => (
137
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
138
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
137
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
138
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
139
139
</svg >
140
140
)
141
141
export default SvgFile
@@ -147,14 +147,14 @@ exports[`cli should support various args: --desc-prop 1`] = `
147
147
"import * as React from 'react'
148
148
const SvgFile = ({ desc , descId , ... props } ) => (
149
149
<svg
150
+ xmlns = " http://www.w3.org/2000/svg"
150
151
width = { 48 }
151
152
height = { 1 }
152
- xmlns = " http://www.w3.org/2000/svg"
153
153
aria-describedby = { descId }
154
154
{ ... props }
155
155
>
156
156
{ desc ? <desc id = { descId } >{ desc } </desc > : null }
157
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
157
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
158
158
</svg >
159
159
)
160
160
export default SvgFile
@@ -165,8 +165,8 @@ export default SvgFile
165
165
exports [` cli should support various args: --expand-props none 1` ] = `
166
166
"import * as React from 'react'
167
167
const SvgFile = () => (
168
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" >
169
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
168
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } >
169
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
170
170
</svg >
171
171
)
172
172
export default SvgFile
@@ -177,8 +177,8 @@ export default SvgFile
177
177
exports [` cli should support various args: --expand-props start 1` ] = `
178
178
"import * as React from 'react'
179
179
const SvgFile = (props) => (
180
- <svg { ... props } width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" >
181
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
180
+ <svg { ... props } xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } >
181
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
182
182
</svg >
183
183
)
184
184
export default SvgFile
@@ -190,13 +190,13 @@ exports[`cli should support various args: --icon 1`] = `
190
190
"import * as React from 'react'
191
191
const SvgFile = (props) => (
192
192
<svg
193
+ xmlns = " http://www.w3.org/2000/svg"
193
194
width = " 1em"
194
195
height = " 1em"
195
196
viewBox = " 0 0 48 1"
196
- xmlns = " http://www.w3.org/2000/svg"
197
197
{ ... props }
198
198
>
199
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
199
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
200
200
</svg >
201
201
)
202
202
export default SvgFile
@@ -208,13 +208,13 @@ exports[`cli should support various args: --icon 2em 1`] = `
208
208
"import * as React from 'react'
209
209
const SvgFile = (props) => (
210
210
<svg
211
+ xmlns = " http://www.w3.org/2000/svg"
211
212
width = " 2em"
212
213
height = " 2em"
213
214
viewBox = " 0 0 48 1"
214
- xmlns = " http://www.w3.org/2000/svg"
215
215
{ ... props }
216
216
>
217
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
217
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
218
218
</svg >
219
219
)
220
220
export default SvgFile
@@ -226,13 +226,13 @@ exports[`cli should support various args: --icon 24 1`] = `
226
226
"import * as React from 'react'
227
227
const SvgFile = (props) => (
228
228
<svg
229
+ xmlns = " http://www.w3.org/2000/svg"
229
230
width = { 24 }
230
231
height = { 24 }
231
232
viewBox = " 0 0 48 1"
232
- xmlns = " http://www.w3.org/2000/svg"
233
233
{ ... props }
234
234
>
235
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
235
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
236
236
</svg >
237
237
)
238
238
export default SvgFile
@@ -242,8 +242,8 @@ export default SvgFile
242
242
243
243
exports [` cli should support various args: --jsx-runtime automatic 1` ] = `
244
244
"const SvgFile = (props) => (
245
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
246
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
245
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
246
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
247
247
</svg >
248
248
)
249
249
export default SvgFile
@@ -254,8 +254,8 @@ export default SvgFile
254
254
exports [` cli should support various args: --jsx-runtime classic-preact 1` ] = `
255
255
"import { h } from 'preact'
256
256
const SvgFile = (props) => (
257
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
258
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
257
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
258
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
259
259
</svg >
260
260
)
261
261
export default SvgFile
@@ -267,8 +267,8 @@ exports[`cli should support various args: --native --expand-props none 1`] = `
267
267
"import * as React from 'react'
268
268
import Svg, { Path } from 'react-native-svg'
269
269
const SvgFile = () => (
270
- <Svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" >
271
- <Path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
270
+ <Svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } >
271
+ <Path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
272
272
</Svg >
273
273
)
274
274
export default SvgFile
@@ -281,13 +281,13 @@ exports[`cli should support various args: --native --icon 1`] = `
281
281
import Svg, { Path } from 'react-native-svg'
282
282
const SvgFile = (props) => (
283
283
<Svg
284
+ xmlns = " http://www.w3.org/2000/svg"
284
285
width = { 24 }
285
286
height = { 24 }
286
287
viewBox = " 0 0 48 1"
287
- xmlns = " http://www.w3.org/2000/svg"
288
288
{ ... props }
289
289
>
290
- <Path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
290
+ <Path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
291
291
</Svg >
292
292
)
293
293
export default SvgFile
@@ -301,13 +301,13 @@ import Svg, { Path } from 'react-native-svg'
301
301
import { forwardRef } from 'react'
302
302
const SvgFile = (props, ref) => (
303
303
<Svg
304
+ xmlns = " http://www.w3.org/2000/svg"
304
305
width = { 48 }
305
306
height = { 1 }
306
- xmlns = " http://www.w3.org/2000/svg"
307
307
ref = { ref }
308
308
{ ... props }
309
309
>
310
- <Path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
310
+ <Path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
311
311
</Svg >
312
312
)
313
313
const ForwardRef = forwardRef(SvgFile)
@@ -320,8 +320,8 @@ exports[`cli should support various args: --native 1`] = `
320
320
"import * as React from 'react'
321
321
import Svg, { Path } from 'react-native-svg'
322
322
const SvgFile = (props) => (
323
- <Svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
324
- <Path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
323
+ <Svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
324
+ <Path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
325
325
</Svg >
326
326
)
327
327
export default SvgFile
@@ -332,8 +332,8 @@ export default SvgFile
332
332
exports [` cli should support various args: --no-dimensions 1` ] = `
333
333
"import * as React from 'react'
334
334
const SvgFile = (props) => (
335
- <svg viewBox = " 0 0 48 1 " xmlns = " http://www.w3.org/2000/svg" { ... props } >
336
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
335
+ <svg xmlns = " http://www.w3.org/2000/svg" viewBox = " 0 0 48 1 " { ... props } >
336
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
337
337
</svg >
338
338
)
339
339
export default SvgFile
@@ -343,7 +343,7 @@ export default SvgFile
343
343
344
344
exports [` cli should support various args: --no-prettier 1` ] = `
345
345
"import * as React from "react";
346
- const SvgFile = props => <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } ><path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" /></svg >;
346
+ const SvgFile = props => <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } ><path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " /></svg >;
347
347
export default SvgFile;
348
348
"
349
349
` ;
@@ -391,13 +391,13 @@ exports[`cli should support various args: --ref 1`] = `
391
391
import { forwardRef } from 'react'
392
392
const SvgFile = (props, ref) => (
393
393
<svg
394
+ xmlns = " http://www.w3.org/2000/svg"
394
395
width = { 48 }
395
396
height = { 1 }
396
- xmlns = " http://www.w3.org/2000/svg"
397
397
ref = { ref }
398
398
{ ... props }
399
399
>
400
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
400
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
401
401
</svg >
402
402
)
403
403
const ForwardRef = forwardRef(SvgFile)
@@ -409,8 +409,8 @@ export default ForwardRef
409
409
exports [` cli should support various args: --replace-attr-values "#063855=currentColor" 1` ] = `
410
410
"import * as React from 'react'
411
411
const SvgFile = (props) => (
412
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
413
- <path d = " M0 0h48v1H0z " fill = " currentColor" fillRule = " evenodd" />
412
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
413
+ <path fill = " currentColor" fillRule = " evenodd" d = " M0 0h48v1H0z " />
414
414
</svg >
415
415
)
416
416
export default SvgFile
@@ -422,14 +422,14 @@ exports[`cli should support various args: --svg-props "hidden={true},id=hello" 1
422
422
"import * as React from 'react'
423
423
const SvgFile = (props) => (
424
424
<svg
425
+ xmlns = " http://www.w3.org/2000/svg"
425
426
width = { 48 }
426
427
height = { 1 }
427
- xmlns = " http://www.w3.org/2000/svg"
428
428
hidden = { true }
429
429
id = " hello"
430
430
{ ... props }
431
431
>
432
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
432
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
433
433
</svg >
434
434
)
435
435
export default SvgFile
@@ -441,14 +441,14 @@ exports[`cli should support various args: --title-prop 1`] = `
441
441
"import * as React from 'react'
442
442
const SvgFile = ({ title , titleId , ... props } ) => (
443
443
<svg
444
+ xmlns = " http://www.w3.org/2000/svg"
444
445
width = { 48 }
445
446
height = { 1 }
446
- xmlns = " http://www.w3.org/2000/svg"
447
447
aria-labelledby = { titleId }
448
448
{ ... props }
449
449
>
450
450
{ title ? <title id = { titleId } >{ title } </title > : null }
451
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
451
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
452
452
</svg >
453
453
)
454
454
export default SvgFile
@@ -468,15 +468,15 @@ const SvgFile = (
468
468
ref: Ref<SVGSVGElement >,
469
469
) => (
470
470
<svg
471
+ xmlns = " http://www.w3.org/2000/svg"
471
472
width = { 48 }
472
473
height = { 1 }
473
- xmlns = " http://www.w3.org/2000/svg"
474
474
ref = { ref }
475
475
aria-describedby = { descId }
476
476
{ ... props }
477
477
>
478
478
{ desc ? <desc id = { descId } >{ desc } </desc > : null }
479
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
479
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
480
480
</svg >
481
481
)
482
482
const ForwardRef = forwardRef(SvgFile)
@@ -497,15 +497,15 @@ const SvgFile = (
497
497
ref: Ref<SVGSVGElement >,
498
498
) => (
499
499
<svg
500
+ xmlns = " http://www.w3.org/2000/svg"
500
501
width = { 48 }
501
502
height = { 1 }
502
- xmlns = " http://www.w3.org/2000/svg"
503
503
ref = { ref }
504
504
aria-labelledby = { titleId }
505
505
{ ... props }
506
506
>
507
507
{ title ? <title id = { titleId } >{ title } </title > : null }
508
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
508
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
509
509
</svg >
510
510
)
511
511
const ForwardRef = forwardRef(SvgFile)
@@ -519,13 +519,13 @@ exports[`cli should support various args: --typescript --ref 1`] = `
519
519
import { SVGProps , Ref , forwardRef } from 'react'
520
520
const SvgFile = (props: SVGProps<SVGSVGElement >, ref: Ref<SVGSVGElement >) => (
521
521
<svg
522
+ xmlns = " http://www.w3.org/2000/svg"
522
523
width = { 48 }
523
524
height = { 1 }
524
- xmlns = " http://www.w3.org/2000/svg"
525
525
ref = { ref }
526
526
{ ... props }
527
527
>
528
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
528
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
529
529
</svg >
530
530
)
531
531
const ForwardRef = forwardRef(SvgFile)
@@ -538,8 +538,8 @@ exports[`cli should support various args: --typescript 1`] = `
538
538
"import * as React from 'react'
539
539
import { SVGProps } from 'react'
540
540
const SvgFile = (props: SVGProps<SVGSVGElement >) => (
541
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
542
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
541
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
542
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
543
543
</svg >
544
544
)
545
545
export default SvgFile
@@ -590,8 +590,8 @@ __fixtures__/withsvgrrc/file.svg -> __fixtures_build__/whole/withsvgrrc/file.tsx
590
590
exports[`cli should work with a simple file 1`] = `
591
591
"import * as React from 'react'
592
592
const SvgFile = (props) => (
593
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
594
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
593
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
594
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
595
595
</svg >
596
596
)
597
597
export default SvgFile
@@ -602,8 +602,8 @@ export default SvgFile
602
602
exports[`cli should work with stdin 1`] = `
603
603
"import * as React from 'react'
604
604
const SvgComponent = (props) => (
605
- <svg width = { 48 } height = { 1 } xmlns = " http://www.w3.org/2000/svg" { ... props } >
606
- <path d = " M0 0h48v1H0z " fill = " #063855" fillRule = " evenodd" />
605
+ <svg xmlns = " http://www.w3.org/2000/svg" width = { 48 } height = { 1 } { ... props } >
606
+ <path fill = " #063855" fillRule = " evenodd" d = " M0 0h48v1H0z " />
607
607
</svg >
608
608
)
609
609
export default SvgComponent
1 commit comments
vercel[bot] commentedon Mar 24, 2023
Successfully deployed to the following URLs:
svgr – ./
svgr-git-main-gregberge.vercel.app
svgr-gregberge.vercel.app
api.react-svgr.com