react-inlinesvg

  • Version 2.3.0
  • Published
  • 84.9 kB
  • 2 dependencies
  • MIT license

Install

npm i react-inlinesvg
yarn add react-inlinesvg
pnpm add react-inlinesvg

Overview

An SVG loader for React

Index

Variables

variable cacheStore

const cacheStore: { [key: string]: StorageItem };

    Classes

    class InlineSVG

    class InlineSVG extends React.PureComponent<Props, State> {}

      constructor

      constructor(props: Props);

        property defaultProps

        static defaultProps: { cacheRequests: boolean; uniquifyIDs: boolean };

          method componentDidMount

          componentDidMount: () => void;

            method componentDidUpdate

            componentDidUpdate: (prevProps: Props, prevState: State) => void;

              method componentWillUnmount

              componentWillUnmount: () => void;

                method render

                render: () => React.ReactNode;

                  Interfaces

                  interface FetchError

                  interface FetchError extends Error {}

                    property code

                    code: string;

                      property errno

                      errno: string;

                        property message

                        message: string;

                          property type

                          type: string;

                            interface Props

                            interface Props
                            extends Omit<React.SVGProps<SVGElement>, 'onLoad' | 'onError' | 'ref'> {}

                              property baseURL

                              baseURL?: string;

                                property cacheRequests

                                cacheRequests?: boolean;

                                  property children

                                  children?: React.ReactNode;

                                    property description

                                    description?: string;

                                      property fetchOptions

                                      fetchOptions?: RequestInit;

                                        property innerRef

                                        innerRef?: React.Ref<SVGElement>;

                                          property loader

                                          loader?: React.ReactNode;

                                            property onError

                                            onError?: ErrorCallback;

                                              property onLoad

                                              onLoad?: LoadCallback;

                                                property preProcessor

                                                preProcessor?: PreProcessorCallback;

                                                  property src

                                                  src: string;

                                                    property title

                                                    title?: string;

                                                      property uniqueHash

                                                      uniqueHash?: string;

                                                        property uniquifyIDs

                                                        uniquifyIDs?: boolean;

                                                          interface State

                                                          interface State {}

                                                            property content

                                                            content: string;

                                                              property element

                                                              element: React.ReactNode;

                                                                property hasCache

                                                                hasCache: boolean;

                                                                  property status

                                                                  status: string;

                                                                    interface StorageItem

                                                                    interface StorageItem {}

                                                                      property content

                                                                      content: string;

                                                                        property queue

                                                                        queue: Callback[];

                                                                          property status

                                                                          status: string;

                                                                            Type Aliases

                                                                            type ErrorCallback

                                                                            type ErrorCallback = (error: Error | FetchError) => void;

                                                                              type LoadCallback

                                                                              type LoadCallback = (src: string, isCached: boolean) => void;

                                                                                type PlainObject

                                                                                type PlainObject<T = unknown> = Record<string | number | symbol, T>;

                                                                                  type PreProcessorCallback

                                                                                  type PreProcessorCallback = (code: string) => string;

                                                                                    Package Files (2)

                                                                                    Dependencies (2)

                                                                                    Dev Dependencies (44)

                                                                                    Peer Dependencies (1)

                                                                                    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-inlinesvg.

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