File tree 2 files changed +10
-5
lines changed
packages/babel-preset/src
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ describe('preset', () => {
213
213
"import * as React from \\"react\\";
214
214
import Svg from \\"react-native-svg\\";
215
215
216
- const SvgComponent = props => <Svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} role =\\"img \\" {...props} />;
216
+ const SvgComponent = props => <Svg a=\\"#000\\" b=\\"#fff\\" width={24} height={24} accessibilityRole =\\"image \\" {...props} />;
217
217
218
218
export default SvgComponent;"
219
219
` )
Original file line number Diff line number Diff line change @@ -50,10 +50,15 @@ function replaceMapToValues(replaceMap: { [key: string]: string }): Value[] {
50
50
const plugin = ( _ : ConfigAPI , opts : Options ) => {
51
51
let toRemoveAttributes = [ 'version' ]
52
52
let toAddAttributes : Attribute [ ] = [
53
- {
54
- name : 'role' ,
55
- value : 'img' ,
56
- } ,
53
+ opts ?. native === true
54
+ ? {
55
+ name : 'accessibilityRole' ,
56
+ value : 'image' ,
57
+ }
58
+ : {
59
+ name : 'role' ,
60
+ value : 'img' ,
61
+ } ,
57
62
]
58
63
59
64
if ( opts . svgProps ) {
You can’t perform that action at this time.
0 commit comments