react-adsense-ad
react-adsense-ad is a React-component for Google AdSense advertisement.
1. Install
npm install --save react-adsense-ad
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-ad'; // ads with no set-up<AdSense.Google ='Your Publisher Id' ='Ad slot Id'/> // ads with custom format<AdSense.Google ='Your Publisher Id' ='Ad slot Id' = =''/> // responsive and native ads<AdSense.Google ='Your Publisher Id' ='Ad slot Id' = ='in-article' ='fluid'/> // auto full width responsive ads<AdSense.Google ='Your Publisher Id' ='Ad slot Id' = ='auto' ='true'/>
3. Props
- Required props:
client
slot
- Optional props:
className
:style
:layout
:format
:responsive
:
LICENSE
MIT@aj-anuragjain.