singleRequest doesn't work in any versions after 3.0.2
Vitaliy-Steffensen opened this issue · 1 comments
In version 3.0.2 singleRequest works right out of the box, but in all the versions released after, it will not do a singleRequest.
If you take a look at this sandbox (https://codesandbox.io/s/gpt-prebid-npm-es6-forked-0k44wy), and if you select react-advertising 3.0.2 or earlier, singleRequest will work as it should. But all versions after will not work, as shown below.
Seems like it actually works all the way up until 4.0.0-beta.3
(maybe even 4.0.0-beta.47.0
but it doesn't compile so we can't know), so the change that broke single request must have happened somewhere here:
v4.0.0-beta.3...v4.0.0-beta.47.1
The most obvious thing that comes to my mind is the change from class component to functional component for AdvertisingSlot
. The useEffect
hook used is not semantically equivalent to componentDidMount
. Perhaps the asynchronous nature of useEffect
causes a wrong order in the flow of registering the ad slots before enabling DFP. It might be that useLayoutEffect
is more appropriate here.