Skip to content

Commit

Permalink
feat: adding id prop for HTML component
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmch committed Oct 27, 2023
1 parent 25fb3c5 commit eca549e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/HTML/HTML.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ export interface HTMLProps {
children?: string;
block?: boolean;
className?: string;
id?: string;
}

export const HTML: React.FC<HTMLProps> = ({children, block = false, className}) => {
export const HTML: React.FC<HTMLProps> = ({children, block = false, className, id}) => {
if (!children) {
return null;
}

return React.createElement(block ? 'div' : 'span', {
dangerouslySetInnerHTML: {__html: children},
className,
id,
});
};

0 comments on commit eca549e

Please sign in to comment.