@syncfusion/react-icons
Version:
Syncfusion React Icons for React applications
16 lines (15 loc) • 597 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { memo } from 'react';
import { SvgIcon } from './svg-icon';
/**
* Base icon component creator function creates a reusable icon component from an SVG path.
*
* @param {string} svgElements - The SVG path data string
* @returns {IconComponent} A memoized React functional component
*/
export const createIcon = (svgElements) => {
const IconComponent = ({ viewBox = '0 0 24 24', ...otherProps }) => {
return (_jsx(SvgIcon, { viewBox: viewBox, ...otherProps, children: svgElements }));
};
return memo(IconComponent);
};