react-svg

  • Version 14.0.15
  • Published
  • 211 kB
  • 4 dependencies
  • MIT license

Install

npm i react-svg
yarn add react-svg
pnpm add react-svg

Overview

A React component that injects SVG into the DOM.

Index

Classes

class ReactSVG

class ReactSVG extends React.Component<Props, State> {}

    property defaultProps

    static defaultProps: {
    afterInjection: () => undefined;
    beforeInjection: () => undefined;
    evalScripts: string;
    fallback: null;
    loading: null;
    renumerateIRIElements: boolean;
    useRequestCache: boolean;
    wrapper: string;
    };

      property initialState

      initialState: { hasError: boolean; isLoading: boolean };

        property nonReactWrapper

        nonReactWrapper?: WrapperType;

          property propTypes

          static propTypes: {
          afterInjection: any;
          beforeInjection: any;
          evalScripts: any;
          fallback: any;
          loading: any;
          renumerateIRIElements: any;
          src: any;
          useRequestCache: any;
          wrapper: any;
          };

            property reactWrapper

            reactWrapper?: WrapperType;

              property refCallback

              refCallback: (reactWrapper: WrapperType | null) => void;

                property state

                state: { hasError: boolean; isLoading: boolean };

                  method componentDidMount

                  componentDidMount: () => void;

                    method componentDidUpdate

                    componentDidUpdate: (prevProps: Props) => void;

                      method componentWillUnmount

                      componentWillUnmount: () => void;

                        method removeSVG

                        removeSVG: () => void;

                          method render

                          render: () => any;

                            method renderSVG

                            renderSVG: () => void;

                              Interfaces

                              interface State

                              interface State {}

                                property hasError

                                hasError: boolean;

                                  property isLoading

                                  isLoading: boolean;

                                    Type Aliases

                                    type Props

                                    type Props = BaseProps &
                                    React.DetailedHTMLProps<React.HTMLAttributes<HTMLWrapperType>, HTMLWrapperType> &
                                    React.SVGProps<SVGWrapperType>;

                                      type WrapperType

                                      type WrapperType = HTMLWrapperType | SVGWrapperType;

                                        Package Files (3)

                                        Dependencies (4)

                                        Dev Dependencies (39)

                                        Peer Dependencies (2)

                                        Badge

                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-svg.

                                        • Markdown
                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-svg)
                                        • HTML
                                          <a href="https://www.jsdocs.io/package/react-svg"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>