UNPKG

react-svg

Version:

A React component that injects SVG into the DOM.

53 lines (52 loc) 1.97 kB
import * as PropTypes from 'prop-types'; import * as React from 'react'; import { Props, State, WrapperType } from './types'; export declare class ReactSVG extends React.Component<Props, State> { 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; }; 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<NonNullable<string | object | null | undefined>>; httpRequestWithCredentials: PropTypes.Requireable<boolean>; loading: PropTypes.Requireable<NonNullable<string | object | null | undefined>>; 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>; }; initialState: { hasError: boolean; isLoading: boolean; }; state: { hasError: boolean; isLoading: boolean; }; _isMounted: boolean; reactWrapper?: WrapperType | null; nonReactWrapper?: WrapperType | null; refCallback: (reactWrapper: WrapperType | null) => void; renderSVG(): void; removeSVG(): void; componentDidMount(): void; componentDidUpdate(prevProps: Props): void; componentWillUnmount(): void; render(): React.JSX.Element; }