diff --git a/src/index.js b/src/index.js
index 9a4bf5a..23d0c83 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,4 +1,4 @@
-import React, { useMemo } from "react";
+import React, { useMemo, useId } from "react";
import Svg, {
Defs,
G,
@@ -23,16 +23,19 @@ const renderLogo = ({
logoColor,
logoMargin,
logoBorderRadius,
+ clipPathId
}) => {
const logoPosition = (size - logoSize - logoMargin * 2) / 2;
const logoBackgroundSize = logoSize + logoMargin * 2;
const logoBackgroundBorderRadius =
logoBorderRadius + (logoMargin / logoSize) * logoBorderRadius;
-
+ const clipLogoBackgroundId = `clip-logo-background-${clipPathId}`;
+ const clipLogoId = `clip-logo-${clipPathId}`;
+
return (
-
+
-
+
-
+
)}
@@ -100,6 +103,8 @@ const QRCode = ({
onError,
testID,
}) => {
+ const clipPathId = useId();
+
const result = useMemo(() => {
try {
return transformMatrixIntoPath(genMatrix(value, ecl), size);
@@ -173,6 +178,7 @@ const QRCode = ({
logoColor,
logoMargin,
logoBorderRadius,
+ clipPathId,
})}
);