react-simple-adsense

It's a very simple Google AdSense component.

Usage no npm install needed!

<script type="module">
  import reactSimpleAdsense from 'https://cdn.skypack.dev/react-simple-adsense';
</script>

README

React Simple AdSense

It is a simple Google AdSense component for React

Getting Started

Installation

npm

npm i react-simple-adsense

yarn

yarn add react-simple-adsense

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import GoogleAdSense from 'react-simple-adsense';

ReactDOM.render(
  <GoogleAdSense
    html={
      '<ins class="adsbygoogle"\n' +
      'style="display:inline-block;width:728px;height:90px"\n' +
      'data-ad-client="YOUT_CLIENT_ID"\n' +
      'data-ad-slot="YOUR_AD_SLOT"></ins>'
    }
  />,
  document.getElementById('root')
);

Required Property

Property Name Type Description
html string ins tag code within Google AdSense advertising unit code

License

This project is licensed under the MIT License - see the LICENSE.md file for details