react-adsense is a React-component for Google AdSense / Baidu advertisement.
npm install react-adsense
Before use Google AdSense, you should add the script
at the end of HTML.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
import React from 'react';
import AdSense from 'react-adsense';
<AdSense.Google client='ca-pub-7292810486004926'
slot='7806394673' />
// or
<AdSense.Google client='ca-pub-7292810486004926'
slot='7806394673'
style={{width: 500, height: 300, float: 'left'}}
format='' />
Baidu
advertisement supported.Google
sync adsense supported.
MIT