nfl / react-gpt

A React display ad component using Google Publisher Tag
MIT License
145 stars 84 forks source link

Don't setState on an unmounted ad. #85

Open ctbarna opened 6 years ago

ctbarna commented 6 years ago

Calling this.setState on an unmounted component throws exceptions in React. Since Bling._adManager is already tracking which ads are mounted, this uses that registry to check whether to call setState in onScriptLoaded.

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 6 years ago

Codecov Report

Merging #85 into master will increase coverage by 0.02%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
+ Coverage   93.96%   93.98%   +0.02%     
==========================================
  Files           8        8              
  Lines         580      582       +2     
==========================================
+ Hits          545      547       +2     
  Misses         35       35
Impacted Files Coverage Δ
src/Bling.js 91.04% <100%> (+0.09%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 60f6ce0...9425436. Read the comment docs.