1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-06 22:26:33 +02:00

Merge pull request #133 from phuoc-ng/fix-ga

Don't generate code for Ads while snapping
This commit is contained in:
phuoc-ng
2020-04-07 17:55:39 +07:00
committed by GitHub

View File

@@ -12,6 +12,10 @@ const Ad: React.FC<{}> = () => {
const source = 'https://cdn.carbonads.com/carbon.js?serve=CE7I6KQL&placement=csslayoutio';
useEffect(() => {
// Ignore if the code is reached in snapping mode
if (navigator.userAgent === 'ReactSnap') {
return;
}
const container = containerRef.current;
if (!container) {
return;