Skip to content

Commit 519f42c

Browse files
committed
Allow omitting css id
1 parent 7904bb8 commit 519f42c

File tree

1 file changed

+4
-2
lines changed
  • packages/webamp/js/components

1 file changed

+4
-2
lines changed

packages/webamp/js/components/Css.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ import { useMemo, useLayoutEffect } from "react";
33

44
type Props = {
55
children: string;
6-
id: string;
6+
id?: string;
77
};
88

99
export default function Css({ children, id }: Props) {
1010
const style = useMemo(() => {
1111
const s = document.createElement("style");
1212
s.type = "text/css";
13-
s.id = id;
13+
if (id != null) {
14+
s.id = id;
15+
}
1416
return s;
1517
}, [id]);
1618

0 commit comments

Comments
 (0)