react-svg
- Version 16.3.0
- Published
- 263 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
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 (45)
- @babel/core
- @babel/plugin-transform-runtime
- @babel/preset-env
- @babel/preset-react
- @eslint/compat
- @eslint/eslintrc
- @eslint/js
- @rollup/plugin-babel
- @rollup/plugin-commonjs
- @rollup/plugin-node-resolve
- @rollup/plugin-replace
- @rollup/plugin-terser
- @testing-library/react
- @types/faker
- @types/jest
- @types/jsdom
- @types/node
- @types/react
- @types/react-dom
- @types/shelljs
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- babel-core
- babel-plugin-transform-react-remove-prop-types
- eslint
- eslint-config-prettier
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-plugin-simple-import-sort
- faker
- jest
- jest-environment-jsdom
- jest-prettyhtml-matchers
- nock
- npm-run-all2
- prettier
- react
- react-dom
- rollup
- shelljs
- shx
- tanem-scripts
- ts-jest
- ts-node
- typescript
Peer Dependencies (2)
Badge
To add a badge like this oneto 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>
- Updated .
Package analyzed in 2491 ms. - Missing or incorrect documentation? Open an issue for this package.