mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +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() {
|
export function AdHorizontal() {
|
||||||
return (
|
useEffect(() => {
|
||||||
<>
|
(window as any).msAdsQueue.push(() => {
|
||||||
<div id="ms-ad-635230699" />
|
(window as any).pubCenterSdk.render({
|
||||||
<script
|
adUnitId: '635230699',
|
||||||
dangerouslySetInnerHTML={{
|
elementId: 'ms-ad-635230699',
|
||||||
__html: `
|
});
|
||||||
window.msAdsQueue.push(() => {
|
});
|
||||||
window.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() {
|
export function Party3() {
|
||||||
|
useEffect(() => {
|
||||||
|
(window as any).msAdsQueue = (window as any).msAdsQueue || [];
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* analytics */}
|
{/* analytics */}
|
||||||
@@ -26,13 +32,6 @@ export function Party3() {
|
|||||||
/> */}
|
/> */}
|
||||||
|
|
||||||
{/* pub center */}
|
{/* pub center */}
|
||||||
<script
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: `
|
|
||||||
window.msAdsQueue = window.msAdsQueue || [];
|
|
||||||
`,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<script
|
<script
|
||||||
async
|
async
|
||||||
src="https://adsdk.microsoft.com/pubcenter/sdk.js?siteId=364477&publisherId=253617120"
|
src="https://adsdk.microsoft.com/pubcenter/sdk.js?siteId=364477&publisherId=253617120"
|
||||||
|
|||||||
Reference in new issue
Block a user