1.0.3 • Published 5 years ago

pubfig-npm v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

#pubfig-npm

####version 1.0.3 - July 25, 2019

##Installing using npm

npm install --save pubfig-npm

##Usage

####Import pubfig package

import pubfig from 'pubfig-npm';

In react add the freestar config object prior to mounting the main App component.

class Navigation extends React.Component {
	componentWillMount() {
		pubfig.configure({"publisherName": "webdesignledger"});
	}
	render() {
		return (
			<div>
				<h1>freestar news</h1>
			</div>
		);
	}
}

####Adding Ad Div Components In React after the div has mounted create an unit object and invoke the addUnit method: 

class Ad300250 extends React.Component {
    componentDidMount(prevProps, prevState) {
		// create unit with keys
        const unit = {
            placementName: 'My_Sidebar_300x250_1',
            slotId: this.props.id
		}
		// invoke addUnit method with unit as first argument
        pubfig.addUnit(unit)
    }
    render() {
            return (
                <div id={this.props.id}>
                </div>
            )
    }
}