File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
packages/babel-preset/src Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ describe('preset', () => {
213213 "import * as React from \\"react\\";
214214 import Svg from \\"react-native-svg\\";
215215
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} />;
217217
218218 export default SvgComponent;"
219219 ` )
Original file line number Diff line number Diff line change @@ -50,10 +50,15 @@ function replaceMapToValues(replaceMap: { [key: string]: string }): Value[] {
5050const plugin = ( _ : ConfigAPI , opts : Options ) => {
5151 let toRemoveAttributes = [ 'version' ]
5252 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+ } ,
5762 ]
5863
5964 if ( opts . svgProps ) {
You can’t perform that action at this time.
0 commit comments