react-svg

  • Version 16.1.34
  • Published
  • 269 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;
    desc: string;
    evalScripts: string;
    fallback: null;
    httpRequestWithCredentials: boolean;
    loading: null;
    onError: () => undefined;
    renumerateIRIElements: boolean;
    title: string;
    useRequestCache: boolean;
    wrapper: string;
    };

      property initialState

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

        property nonReactWrapper

        nonReactWrapper?: WrapperType;

          property propTypes

          static propTypes: {
          afterInjection: PropTypes.Requireable<(...args: any[]) => any>;
          beforeInjection: PropTypes.Requireable<(...args: any[]) => any>;
          desc: PropTypes.Requireable<string>;
          evalScripts: PropTypes.Requireable<string>;
          fallback: PropTypes.Requireable<string | object>;
          httpRequestWithCredentials: PropTypes.Requireable<boolean>;
          loading: PropTypes.Requireable<string | object>;
          onError: PropTypes.Requireable<(...args: any[]) => any>;
          renumerateIRIElements: PropTypes.Requireable<boolean>;
          src: PropTypes.Validator<string>;
          title: PropTypes.Requireable<string>;
          useRequestCache: PropTypes.Requireable<boolean>;
          wrapper: PropTypes.Requireable<string>;
          };

            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: () => React.JSX.Element;

                            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 (42)

                                        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>