File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -82,15 +82,14 @@ const ignoredSvgPropKeys = [
82
82
"tref" , "color-profile" , "cursor" ,
83
83
]
84
84
85
- const camelCaseSvgProps = { }
86
- Object . keys ( svgProps ) . forEach ( elName => {
87
- if ( ! ignoredSvgPropKeys . includes ( elName ) ) {
88
- const elAttrs = svgProps [ elName ] . map ( changeCase . camelCase ) ;
89
- // style is already included in SharedSVGProps
90
- delete elAttrs [ 'style' ] ;
91
- camelCaseSvgProps [ elName ] = elAttrs ;
92
- }
93
- } ) ;
85
+ const camelCaseSvgProps = Object . fromEntries (
86
+ Object . entries ( svgProps )
87
+ . filter ( ( [ elName ] ) => ! ignoredSvgPropKeys . includes ( elName ) ) // Exclude ignored keys
88
+ . map ( ( [ elName , attrs ] ) => [
89
+ elName ,
90
+ attrs . map ( changeCase . camelCase ) . filter ( attr => attr !== "style" ) , // Convert & filter immutably
91
+ ] )
92
+ ) ;
94
93
95
94
// The attribute list for <svg> in react-html-attributes
96
95
// is wrong (it contains the union of the attributes of all
You can’t perform that action at this time.
0 commit comments