react-inlinesvg

  • Version 4.1.3
  • Published
  • 132 kB
  • 1 dependency
  • 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

let cacheStore: CacheStore;

    variable STATUS

    const STATUS: {
    readonly IDLE: 'idle';
    readonly LOADING: 'loading';
    readonly LOADED: 'loaded';
    readonly FAILED: 'failed';
    readonly READY: 'ready';
    readonly UNSUPPORTED: 'unsupported';
    };

      Functions

      function InlineSVG

      InlineSVG: typeof InlineSVG;

        function InlineSVG

        InlineSVG: typeof InlineSVG;

          Interfaces

          interface FetchError

          interface FetchError extends Error {}

            property code

            code: string;

              property errno

              errno: string;

                property message

                message: string;

                  property type

                  type: string;

                    interface State

                    interface State {}

                      property content

                      content: string;

                        property element

                        element: React.ReactNode;

                          property isCached

                          isCached: boolean;

                            property status

                            status: Status;

                              interface StorageItem

                              interface StorageItem {}

                                property content

                                content: string;

                                  property status

                                  status: Status;

                                    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, T>;

                                          type PreProcessorCallback

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

                                            type Props

                                            type Props = Simplify<
                                            Omit<React.SVGProps<SVGElement>, 'onLoad' | 'onError' | 'ref'> & {
                                            baseURL?: string;
                                            cacheRequests?: boolean;
                                            children?: React.ReactNode;
                                            description?: string;
                                            fetchOptions?: RequestInit;
                                            innerRef?: React.Ref<SVGElement>;
                                            loader?: React.ReactNode;
                                            onError?: ErrorCallback;
                                            onLoad?: LoadCallback;
                                            preProcessor?: PreProcessorCallback;
                                            src: string;
                                            title?: string | null;
                                            uniqueHash?: string;
                                            uniquifyIDs?: boolean;
                                            }
                                            >;

                                              type Simplify

                                              type Simplify<T> = {
                                              [KeyType in keyof T]: T[KeyType];
                                              } & {};

                                                type Status

                                                type Status = (typeof STATUS)[keyof typeof STATUS];

                                                  Package Files (1)

                                                  Dependencies (1)

                                                  Dev Dependencies (29)

                                                  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>