From c140dcd41267e9af6b1885ca3a25e8eb60d0afa5 Mon Sep 17 00:00:00 2001 From: Shane Williams Date: Sun, 3 Nov 2024 11:36:28 +0000 Subject: [PATCH] Only replace color if present, was causing bug with original style Removed use client directive, caused failure in github build --- src/DevIcon.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DevIcon.tsx b/src/DevIcon.tsx index 0805b33..32b4476 100644 --- a/src/DevIcon.tsx +++ b/src/DevIcon.tsx @@ -1,5 +1,3 @@ -"use client"; - import { type CSSProperties, useCallback, useEffect, useState } from "react"; import { Loader } from "./components/loader"; import { type Scale, dimensions } from "./lib/constants/size"; @@ -106,10 +104,12 @@ export function DevIcon(props: DevIconProps) { style={style} // Replace all color values to the provided color dangerouslySetInnerHTML={{ - __html: svgContent.replace( - /fill="[^"]*"/g, - `fill="${props.color || "currentColor"}"`, - ), + __html: props?.color + ? svgContent.replace( + /fill="[^"]*"/g, + `fill="${props.color || "currentColor"}"`, + ) + : svgContent, }} /> );