diff --git a/.eslintrc.js b/.eslintrc.js index 8886877a..c7c32195 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,6 +12,10 @@ module.exports = { 'react-native/react-native': true, }, settings: { + 'import/core-modules': [ + 'react-native-svg', + 'react-native-svg/css', + ], 'import/resolver': { 'babel-module': { extensions: ['.js', '.jsx', '.ts', '.tsx'], diff --git a/Example/metro.config.js b/Example/metro.config.js index 7efd0fe1..9b8b551b 100644 --- a/Example/metro.config.js +++ b/Example/metro.config.js @@ -57,7 +57,6 @@ const config = { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, - inlineRequires: true, }, }), }, diff --git a/FabricExample/metro.config.js b/FabricExample/metro.config.js index 6bb48e13..74235f11 100644 --- a/FabricExample/metro.config.js +++ b/FabricExample/metro.config.js @@ -44,7 +44,6 @@ const config = { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, - inlineRequires: true, }, }), }, diff --git a/TestsExample/metro.config.js b/TestsExample/metro.config.js index 2b936d1c..8891b995 100644 --- a/TestsExample/metro.config.js +++ b/TestsExample/metro.config.js @@ -40,7 +40,6 @@ const config = { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, - inlineRequires: true, }, }), }, diff --git a/TestsExample/src/Test1813.tsx b/TestsExample/src/Test1813.tsx index 0b7907d9..b70e4474 100644 --- a/TestsExample/src/Test1813.tsx +++ b/TestsExample/src/Test1813.tsx @@ -1,9 +1,18 @@ import React from 'react'; -import { SvgFromUri, SvgFromXml, SvgUri, SvgXml, SvgCss, SvgCssUri, SvgWithCss, SvgWithCssUri, WithLocalSvg, LocalSvg } from 'react-native-svg'; +import {SvgFromUri, SvgFromXml, SvgUri, SvgXml} from 'react-native-svg'; +import { + SvgCss, + SvgCssUri, + SvgWithCss, + SvgWithCssUri, + WithLocalSvg, + LocalSvg, +} from 'react-native-svg/css'; const asset = require('../assets/ruby.svg'); -const normalUri = "https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/ruby.svg"; -const uriWithCss = "http://thenewcode.com/assets/svg/accessibility.svg"; +const normalUri = + 'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/ruby.svg'; +const uriWithCss = 'http://thenewcode.com/assets/svg/accessibility.svg'; const xml = ` { - const [uri, setUri] = React.useState('https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/not_existing.svg') + const [uri, setUri] = React.useState( + 'https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/not_existing.svg', + ); return ( <> @@ -49,54 +60,30 @@ export default () => { height="100" uri={uri} /> - console.log(error)} + console.log(error)} width="100" height="100" uri={normalUri} /> - - - - console.log(error)} + + + + console.log(error)} width="100" height="100" uri={uriWithCss} /> - - console.log(error)} + + console.log(error)} width="100" height="100" uri={uriWithCss} /> - - + + ); -} +}; diff --git a/USAGE.md b/USAGE.md index 074b18d6..fe244a27 100644 --- a/USAGE.md +++ b/USAGE.md @@ -91,7 +91,7 @@ If remote SVG file contains CSS in `