Skip to content

Commit c140dcd

Browse files
author
Shane Williams
committed
Only replace color if present, was causing bug with original style
Removed use client directive, caused failure in github build
1 parent 030f785 commit c140dcd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/DevIcon.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"use client";
2-
31
import { type CSSProperties, useCallback, useEffect, useState } from "react";
42
import { Loader } from "./components/loader";
53
import { type Scale, dimensions } from "./lib/constants/size";
@@ -106,10 +104,12 @@ export function DevIcon(props: DevIconProps) {
106104
style={style}
107105
// Replace all color values to the provided color
108106
dangerouslySetInnerHTML={{
109-
__html: svgContent.replace(
110-
/fill="[^"]*"/g,
111-
`fill="${props.color || "currentColor"}"`,
112-
),
107+
__html: props?.color
108+
? svgContent.replace(
109+
/fill="[^"]*"/g,
110+
`fill="${props.color || "currentColor"}"`,
111+
)
112+
: svgContent,
113113
}}
114114
/>
115115
);

0 commit comments

Comments
 (0)