Untitled
Anonymous
plain_text
03/05/2024 11:44 AM
664 B
15
Indexable
window.testIds = {};
export const VisibleIdsContextWrapper = ({
children,
id,
}: PropsWithChildren<{ id: ClickstreamProps["clickstreamId"] }>) => {
useEffect(() => {
const strId = id.toString();
if (window.testIds[strId]) {
throw new Error(`Duplicate id: ${strId}`);
}
window.testIds[strId] = true;
return () => {
delete window.testIds[strId];
};
}, [id]);
return <>{children}</>;
};Editor is loading...
Leave a Comment