react-adsense
react-adsense is a React-component for Google AdSense / Baidu advertisement.
1. Install
npm install --save react-adsense
Before use Google AdSense, you should add the script
at the end of HTML.
2. Usage
import React from 'react';import AdSense from 'react-adsense'; // ads with no set-up<AdSense.Google ='ca-pub-7292810486004926' ='7806394673'/> // ads with custom format<AdSense.Google ='ca-pub-7292810486004926' ='7806394673' = =''/> // responsive and native ads<AdSense.Google ='ca-pub-7292810486004926' ='7806394673' = ='in-article' ='fluid'/> // auto full width responsive ads<AdSense.Google ='ca-pub-7292810486004926' ='7806394673' = ='auto' ='true' ='-gw-1+2a-9x+5c'/>
3. Props
- Required props:
client
slot
- Optional props:
className
:style
:layout
:layoutKey
:format
:responsive
:
4. TODO
Baidu
advertisement supported.
LICENSE
MIT@hustcc.