Skip to content

In the development on the HarmonyOS side, it was found that the SVG library contains the "err" content, but "err" is not exported. #2843

@HouYang6868

Description

@HouYang6868

Description

In the development on the HarmonyOS side, it was found that the SVG library contains the "err" content, but "err" is not exported.

react-native-svg\src\xml.tsx 中 New additions are needed.
const err = console.error.bind(console);

  • export { err };

react-native-svg\src\ReactNativeSVG.ts New additions are needed.
import {
AstProps,
camelCase,

  • err,
    JsxAST,
    Middleware,
    parse,
    Styles,
    SvgAst,
    SvgFromUri,
    SvgFromXml,
    SvgUri,
    SvgXml,
    UriProps,
    UriState,
    XmlAST,
    XmlProps,
    XmlState,
    } from './xml';

export {
camelCase,

  • err,
    fetchText,
    parse,
    RNSVGCircle,
    RNSVGClipPath,
    RNSVGDefs,
    RNSVGEllipse,
    RNSVGFeColorMatrix,
    RNSVGFeComposite,
    RNSVGFeGaussianBlur,
    RNSVGFeMerge,
    RNSVGFeOffset,
    RNSVGFilter,
    RNSVGForeignObject,
    RNSVGGroup,
    RNSVGImage,
    RNSVGLine,
    RNSVGLinearGradient,
    RNSVGMarker,
    RNSVGMask,
    RNSVGPath,
    RNSVGPattern,
    RNSVGRadialGradient,
    RNSVGRect,
    RNSVGSvgAndroid,
    RNSVGSvgIOS,
    RNSVGSymbol,
    RNSVGText,
    RNSVGTextPath,
    RNSVGTSpan,
    RNSVGUse,
    Shape,
    SvgAst,
    SvgFromUri,
    SvgFromXml,
    SvgUri,
    SvgXml,
    };

Steps to reproduce

  1. When using the library, I found that it has an err function.
  2. But when using it specifically, I found that it was not exported.

Snack or a link to a repository

https://gitcode.com/openharmony-sig/rntpc_react-native-svg/blob/br_rnoh0.77/src/index.tsx

SVG version

15.12.0

React Native version

0.77.1

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

HarmonyOS 6.0.0

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing reproThis issue need minimum repro scenario

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions