-
Notifications
You must be signed in to change notification settings - Fork 49k
Closed
Description
For Ad performance in an isomorphic application we need React to avoid rendering an Ad Component containing an ad position div on the client initial load. Here is the following scenario:
- React renders the ad position div on the server and sends html to client. This div is an empty div with an id attribute identifying the location to place an ad.
- Google gpt makes a request for ad before React lifecycle is finished on client, and the ad position div gets filled with an ad.
- React finds a mismatch with server and client ad position div, so it re-renders the empty ad position div on client wiping out the ad.
If there is a way to conditionally stop React from rendering the ad position div on the client, we have not found it.
Seems like there needs to be a flag or method in the react lifecycle that can be used to prevent a component render on certain conditions.
pxwise, vsnig, Ghanshyam-K-Dobariya, ironspecs, eliseumds and 11 more
Metadata
Metadata
Assignees
Labels
No labels