{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/8017","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/8017/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/8017/comments","events_url":"https://api.github.com/repos/facebook/react/issues/8017/events","html_url":"https://github.com/facebook/react/issues/8017","id":183967158,"number":8017,"title":"Need a way to prevent component render on client side initial load","user":{"login":"scsherwood","id":4631674,"avatar_url":"https://avatars.githubusercontent.com/u/4631674?v=3","gravatar_id":"","url":"https://api.github.com/users/scsherwood","html_url":"https://github.com/scsherwood","followers_url":"https://api.github.com/users/scsherwood/followers","following_url":"https://api.github.com/users/scsherwood/following{/other_user}","gists_url":"https://api.github.com/users/scsherwood/gists{/gist_id}","starred_url":"https://api.github.com/users/scsherwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scsherwood/subscriptions","organizations_url":"https://api.github.com/users/scsherwood/orgs","repos_url":"https://api.github.com/users/scsherwood/repos","events_url":"https://api.github.com/users/scsherwood/events{/privacy}","received_events_url":"https://api.github.com/users/scsherwood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-19T13:49:28Z","updated_at":"2016-10-25T18:54:03Z","closed_at":null,"body":"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:\r\n\r\n1. 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.\r\n2. Google gpt makes a request for ad before React lifecycle is finished on client, and the ad position div gets filled with an ad.\r\n3. 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.\r\n\r\nIf there is a way to conditionally stop React from rendering the ad position div on the client, we have not found it.\r\n\r\nSeems 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."},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/256139046","html_url":"https://github.com/facebook/react/issues/8017#issuecomment-256139046","issue_url":"https://api.github.com/repos/facebook/react/issues/8017","id":256139046,"user":{"login":"scsherwood","id":4631674,"avatar_url":"https://avatars.githubusercontent.com/u/4631674?v=3","gravatar_id":"","url":"https://api.github.com/users/scsherwood","html_url":"https://github.com/scsherwood","followers_url":"https://api.github.com/users/scsherwood/followers","following_url":"https://api.github.com/users/scsherwood/following{/other_user}","gists_url":"https://api.github.com/users/scsherwood/gists{/gist_id}","starred_url":"https://api.github.com/users/scsherwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scsherwood/subscriptions","organizations_url":"https://api.github.com/users/scsherwood/orgs","repos_url":"https://api.github.com/users/scsherwood/repos","events_url":"https://api.github.com/users/scsherwood/events{/privacy}","received_events_url":"https://api.github.com/users/scsherwood/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T18:54:03Z","updated_at":"2016-10-25T18:54:03Z","body":"We are trying to get out in front of the React render to get faster\nperformance out of the ads.  Waiting on react costs us around 500 to 1000\nms before the ad call is made.\n\n*Steven **Sherwood  *\n*w:* 770-226-2527      *e:* steven.sherwood@weather.com\n<http://weather.com/apps> <http://weather.com/apps>\n<http://weather.com/apps> <http://weather.com/apps>\n<http://weather.com/apps> <http://weather.com/apps>\n\nOn Tue, Oct 25, 2016 at 11:18 AM, Jonathon Blok <notifications@github.com>\nwrote:\n\n> @scsherwood <https://github.com/scsherwood> Can't you just make the\n> Google gpt request in componentDidMount, and then rerender with the results\n> of this call. So react will finish 'rendering' the same markup as was sent\n> from the server, and the ad request can happen separately after initial\n> rendering is complete.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/facebook/react/issues/8017#issuecomment-256065424>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AEasemDdfdnGKbHGiTdVUhF7jnoO8vWyks5q3h3CgaJpZM4Ka_m4>\n> .\n>\n"}}
{"actor":{"display_login":"scsherwood"}}