![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A React component for Google Publisher Tags.
* Synchronous rendering requires that the GPT JavaScript be loaded synchronously.
$ yarn react-gpt
React GPT depends on Promise to be available in browser. If your application support the browser which doesn't support Promise, please include the polyfill.
Import React GPT and pass props to the component.
import {Bling as GPT} from "react-gpt";
class Application extends React.Component {
render() {
return (
<GPT
adUnitPath="/4595/nfl.test.open"
slotSize={[728, 90]}
/>
);
}
}
You at least need to pass adUnitPath
and one of slotSize
and sizeMapping
.
To enable Single Request Mode, call Bling.enableSingleRequest()
before rendering any ad.
It defaults to Asynchronous Rendering Mode
if not set.
import {Bling as GPT} from "react-gpt";
GPT.enableSingleRequest();
class Application extends React.Component {
render() {
return (
<div id="ad-1">
<GPT
adUnitPath="/4595/nfl.test.open"
slotSize={[728, 90]}
/>
</div>
<div id="ad-2">
<GPT
adUnitPath="/4595/nfl.test.open"
slotSize={[300, 250]}
/>
</div>
);
}
}
The above example will make one request to the server to render both ads which makes it easier to ensure category exclusion.
If you pass sizeMapping
props instead of slotSize
, React GPT listens for the viewport width change and refreshes an ad when the break point is hit.
import {Bling as GPT} from "react-gpt";
class Application extends React.Component {
render() {
return (
<GPT
adUnitPath="/4595/nfl.test.open"
sizeMapping={[
{viewport: [0, 0], slot: [320, 50]},
{viewport: [750, 0], slot: [728, 90]},
{viewport: [1050, 0], slot: [1024, 120]}
]}
/>
);
}
}
React GPT
APIyarn
npm run examples
for client side rendering, npm start
for server side rendering.Please take a moment to review the guidelines for contributing.
MIT
2.0.1 (2018-03-13)
onSlotOnload
event["fluid"]
slotSize as an array<a name="2.0.0"></a>
FAQs
A react display ad component using Google Publisher Tag
The npm package react-gpt receives a total of 2,569 weekly downloads. As such, react-gpt popularity was classified as popular.
We found that react-gpt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.