Skip to content

Commit

Permalink
fix: imports and remove err export (#2270)
Browse files Browse the repository at this point in the history
# Summary

* Removed `err` export from root file (ReactNativeSVG)
* replaced imports from `react-native-svg` with relative imports inside
`src` dir

Resolves #2265
  • Loading branch information
jakex7 authored May 9, 2024
1 parent ee63425 commit 3f9690d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/ReactNativeSVG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
SvgUri,
SvgXml,
camelCase,
err,
fetchText,
JsxAST,
Middleware,
Expand Down Expand Up @@ -139,7 +138,6 @@ export {
SvgUri,
SvgXml,
camelCase,
err,
fetchText,
Shape,
RNSVGMarker,
Expand Down
4 changes: 3 additions & 1 deletion src/css/css.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
XmlProps,
XmlState,
} from 'react-native-svg';
import { camelCase, err, fetchText, parse, SvgAst } from 'react-native-svg';
import { camelCase, fetchText, parse, SvgAst } from 'react-native-svg';
import type {
Atrule,
AtrulePrelude,
Expand All @@ -27,6 +27,8 @@ import csstree, { List } from 'css-tree';
import type { Options } from 'css-select';
import cssSelect from 'css-select';

const err = console.error.bind(console);

/*
* Style element inlining experiment based on SVGO
* https://github.com/svg/svgo/blob/11f9c797411a8de966aacc4cb83dbb3e471757bc/plugins/inlineStyles.js
Expand Down
2 changes: 1 addition & 1 deletion src/xml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function SvgAst({ ast, override }: AstProps) {
);
}

export const err = console.error.bind(console);
const err = console.error.bind(console);

export function SvgXml(props: XmlProps) {
const { onError = err, xml, override, fallback } = props;
Expand Down

0 comments on commit 3f9690d

Please sign in to comment.