@@ -40,8 +40,6 @@ var svgObjectMap = {
40
40
function convert ( createElement , element ) {
41
41
var extraProps = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : { } ;
42
42
43
- // console.log(`DEBUG: in convert. element.tag = ${element.tag} and extraProps = `, extraProps)
44
- // console.log(`DEBUG: in convert. element.attributes = `, element.attributes)
45
43
if ( typeof element === 'string' ) {
46
44
return element ;
47
45
}
@@ -56,22 +54,22 @@ function convert(createElement, element) {
56
54
case 'class' :
57
55
case 'role' :
58
56
case 'style' : // TODO: when react-native-svg supports the style prop, there may be a better way to do this.
59
- // In the meantime, we're manually peeling off specific style properties, namely color, and passing them down
60
- // to children as a fill prop
57
+ // In the meantime, (below) we'll manually peel off any color property passed in via the "style" prop
58
+ // and assign it as the value of the " fill" attribute.
61
59
// See: https://github.com/react-native-community/react-native-svg/commit/e7d0eb6df676d4f63f9eba7c0cf5ddd6c4c85fbe
62
60
63
61
case 'xmlns' :
64
62
delete element . attributes [ key ] ;
65
63
break ;
66
64
67
65
case 'fill' :
68
- // TODO: probably want to keep fill, but just translate 'currentColor' to 'black'
69
- // When react-native-svg supports currentColor, pass it through
66
+ // TODO: When react-native-svg supports currentColor, pass it through
67
+ // In the meantime, just translate 'currentColor' to 'black'
68
+ // See: https://github.com/react-native-community/react-native-svg/commit/1827b918833efdaa25cfc1a76df2164cb2bcdd2b
70
69
acc . attrs [ key ] = val === 'currentColor' ? 'black' : val ;
71
70
break ;
72
71
73
72
default :
74
- // console.log(`DEBUG: for element tag <${element.tag}>, setting prop key=val to ${key}=`, val)
75
73
if ( key . indexOf ( 'aria-' ) === 0 || key . indexOf ( 'data-' ) === 0 ) {
76
74
delete element . attributes [ key ] ;
77
75
} else {
@@ -93,8 +91,7 @@ function convert(createElement, element) {
93
91
94
92
if ( extraProps . style && extraProps . style . color ) {
95
93
modifiedExtraProps [ 'fill' ] = extraProps . style . color ;
96
- } // console.log(`DEBUG: while creating element with tag=${element.tag}, we have extraProps: `, extraProps )
97
-
94
+ }
98
95
99
96
return createElement . apply ( void 0 , [ svgObjectMap [ element . tag ] , _objectSpread ( { } , mixins . attrs , modifiedExtraProps ) ] . concat ( _toConsumableArray ( children ) ) ) ;
100
97
}
0 commit comments