mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: use use effect
This commit is contained in:
1 parent
57cd3aae50
commit
0b4829abd3
2 files changed
+18
-24
No files matched your search
@@ -1,19 +1,14 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export function AdHorizontal() {
|
||||
return (
|
||||
<>
|
||||
<div id="ms-ad-635230699" />
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.msAdsQueue.push(() => {
|
||||
window.pubCenterSdk.render({
|
||||
adUnitId: "635230699",
|
||||
elementId: "ms-ad-635230699"
|
||||
});
|
||||
});
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
useEffect(() => {
|
||||
(window as any).msAdsQueue.push(() => {
|
||||
(window as any).pubCenterSdk.render({
|
||||
adUnitId: '635230699',
|
||||
elementId: 'ms-ad-635230699',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return <div id="ms-ad-635230699" />;
|
||||
}
|
||||
@@ -1,4 +1,10 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export function Party3() {
|
||||
useEffect(() => {
|
||||
(window as any).msAdsQueue = (window as any).msAdsQueue || [];
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* analytics */}
|
||||
@@ -26,13 +32,6 @@ export function Party3() {
|
||||
/> */}
|
||||
|
||||
{/* pub center */}
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.msAdsQueue = window.msAdsQueue || [];
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
<script
|
||||
async
|
||||
src="https://adsdk.microsoft.com/pubcenter/sdk.js?siteId=364477&publisherId=253617120"
|
||||
|
||||
Reference in new issue
Block a user