我的网站上没有使用 React js 显示 Adsense

问题描述

我尝试在我的网站(laravel 项目)上展示 adsense 广告,但广告没有显示。工程编译和一切,但我没有看到广告。我想在标题下方显示广告。这是我使用的代码

你知道为什么它没有出现在我的网站上吗?我编码错了吗?

import React from 'react'
import { StyledDiv } from './style'
import Game from '../Vod/filterVod'
import Vod from '../Vod/streamerVod'
import GameList from '../Game'
import Streamer from '../StreamerList/searchStreamer'
import LatestVod from '../Vod/latestVod'
import { SkeleVodLoading,SkeleLatestLoading } from '../../global/skleton';
import AdSense from 'react-adsense';


<AdSense.Google
  client='ca-pub-123456789123456'
  slot='1234567891'
  style={{ width: 500,height: 300,float: 'center' }}
  format='float'
/>

const ListContent = (props) => {
  const { vods,filter,title,type,profile } = props
  const homeTitle = "Top Trending Twitch Vods Right Now"

  const LatestVideo = () => {
    return (
      <div className="mt-3">
        {
          vods.length > 0 ?
            vods.map((vod,i) => (
              <LatestVod data={vod} key={i} />
            )) :
            <div className="row">
              {[...Array(12)].map((item,i) => (<SkeleLatestLoading key={i} />))}
            </div>
        }
      </div>
    )
  }

  return (
    <div className="container">
      <StyledDiv>
        {title === homeTitle ? homeTitle : `${title} Twitch Vods`}
      </StyledDiv>
      {
        title === "News" ?
          <LatestVideo /> :
          <div className="mt-3">
            <div>{profile && type.game && <GameList game={profile} />}</div>
            <div>{profile && type.user && <Streamer streamer={profile} title={title} />}</div>
            <div className="row">
              {
                vods.length > 0 ? vods.map((vod,i) => (
                  filter ? <Game vod={vod} title={title} key={i} /> : <Vod vod={vod} title={title} key={i} />
                )) :
                  [...Array(12)].map((item,i) => (
                    <SkeleVodLoading key={i} />
                  ))
              }
            </div>
          </div>
      }
    </div>
  )
}

export default ListContent

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)