diff --git a/packages/babel-preset/src/index.test.ts b/packages/babel-preset/src/index.test.ts
index 8460c9fe..18945f50 100644
--- a/packages/babel-preset/src/index.test.ts
+++ b/packages/babel-preset/src/index.test.ts
@@ -28,7 +28,7 @@ describe('preset', () => {
).toMatchInlineSnapshot(`
"import * as React from \\"react\\";
- const SvgComponent = () => ;
+ const SvgComponent = () => ;
export default SvgComponent;"
`)
@@ -45,7 +45,7 @@ describe('preset', () => {
const SvgComponent = ({
title,
titleId
- }) => ;
+ }) => ;
export default SvgComponent;"
`)
@@ -62,7 +62,7 @@ describe('preset', () => {
const SvgComponent = ({
title,
titleId
- }) => ;
+ }) => ;
export default SvgComponent;"
`)
@@ -77,7 +77,7 @@ describe('preset', () => {
const SvgComponent = ({
title,
titleId
- }) => ;
+ }) => ;
export default SvgComponent;"
`)
@@ -94,7 +94,7 @@ describe('preset', () => {
const SvgComponent = ({
desc,
descId
- }) => ;
+ }) => ;
export default SvgComponent;"
`)
@@ -111,7 +111,7 @@ describe('preset', () => {
const SvgComponent = ({
desc,
descId
- }) => ;
+ }) => ;
export default SvgComponent;"
`)
@@ -126,7 +126,7 @@ describe('preset', () => {
const SvgComponent = ({
desc,
descId
- }) => ;
+ }) => ;
export default SvgComponent;"
`)
@@ -146,7 +146,7 @@ describe('preset', () => {
titleId,
desc,
descId
- }) => ;
+ }) => ;
export default SvgComponent;"
`)
@@ -163,7 +163,7 @@ describe('preset', () => {
).toMatchInlineSnapshot(`
"import * as React from \\"react\\";
- const SvgComponent = () => ;
+ const SvgComponent = () => ;
export default SvgComponent;"
`)
@@ -179,7 +179,7 @@ describe('preset', () => {
).toMatchInlineSnapshot(`
"import * as React from \\"react\\";
- const SvgComponent = props => ;
+ const SvgComponent = props => ;
export default SvgComponent;"
`)
@@ -195,7 +195,7 @@ describe('preset', () => {
).toMatchInlineSnapshot(`
"import * as React from \\"react\\";
- const SvgComponent = props => ;
+ const SvgComponent = props => ;
export default SvgComponent;"
`)
@@ -213,7 +213,7 @@ describe('preset', () => {
"import * as React from \\"react\\";
import Svg from \\"react-native-svg\\";
- const SvgComponent = props => ;
+ const SvgComponent = props => ;
export default SvgComponent;"
`)
diff --git a/packages/babel-preset/src/index.ts b/packages/babel-preset/src/index.ts
index c77b2396..7a5b1b39 100644
--- a/packages/babel-preset/src/index.ts
+++ b/packages/babel-preset/src/index.ts
@@ -49,7 +49,12 @@ function replaceMapToValues(replaceMap: { [key: string]: string }): Value[] {
const plugin = (_: ConfigAPI, opts: Options) => {
let toRemoveAttributes = ['version']
- let toAddAttributes: Attribute[] = []
+ let toAddAttributes: Attribute[] = [
+ {
+ name: 'role',
+ value: 'img',
+ },
+ ]
if (opts.svgProps) {
toAddAttributes = [...toAddAttributes, ...propsToAttributes(opts.svgProps)]
diff --git a/packages/cli/src/__snapshots__/index.test.ts.snap b/packages/cli/src/__snapshots__/index.test.ts.snap
index f05c6526..8bbce21b 100644
--- a/packages/cli/src/__snapshots__/index.test.ts.snap
+++ b/packages/cli/src/__snapshots__/index.test.ts.snap
@@ -10,7 +10,7 @@ exports[`cli should not override config with cli defaults 1`] = `
"import * as React from 'react'
const SvgFile = () => (
-