News for hackers. Stuff that matters.
Re:React JS Best Practices by spicyj on Saturday May 09, 2015 @11:38AM (#9516674)
Never used Google Ads, but you should be able to do something like

  var GoogleAd = React.createClass({
    getInitialState: function() {
      return {
        id: makeUniqueId()
      };
    },
    render: function() {
      // Since this is always the same, React won't try to change the contents
      return <div id={this.state.id} />;
    },
    componentDidMount: function() {
      googletag.defineSlot('/1234567/sports', [728, 90], this.state.id);
    },
    componentWillUnmount: function() {
      // Clean up the slot and any other resources here
    }
  });
and then not worry about it.
Re:React JS Best Practices by mbrock on Saturday May 09, 2015 @01:05PM (#9516930)
It would probably be good to supply a `key` property to the div to ensure that React never tries to reuse it (say, when changing from one GoogleAd to another).