A Simple React component for Google AdSense and Baidu advertisement.
npm install react-adsense> react-adsense is a React-component for Google AdSense / Baidu advertisement.





> npm install --save react-adsense
Before use Google AdSense, you should add the script at the end of HTML.
``html`
`jsx
import React from 'react';
import AdSense from 'react-adsense';
// ads with no set-up
slot='7806394673'
/>
// ads with custom format
slot='7806394673'
style={{ width: 500, height: 300, float: 'left' }}
format=''
/>
// responsive and native ads
slot='7806394673'
style={{ display: 'block' }}
layout='in-article'
format='fluid'
/>
// auto full width responsive ads
slot='7806394673'
style={{ display: 'block' }}
format='auto'
responsive='true'
layoutKey='-gw-1+2a-9x+5c'
/>
`
- Required props:
- clientslot
- className
- Optional props:
- :style
- :layout
- :layoutKey
- :format
- :responsive
- :
- Baidu` advertisement supported.
MIT@hustcc.