Untitled
unknown
plain_text
2 years ago
497 B
5
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