{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/1252","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/1252/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/1252/comments","events_url":"https://api.github.com/repos/facebook/react/issues/1252/events","html_url":"https://github.com/facebook/react/issues/1252","id":29305014,"number":1252,"title":"noscript contents cause invariant violation","user":{"login":"matthewwithanm","id":126263,"avatar_url":"https://avatars.githubusercontent.com/u/126263?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewwithanm","html_url":"https://github.com/matthewwithanm","followers_url":"https://api.github.com/users/matthewwithanm/followers","following_url":"https://api.github.com/users/matthewwithanm/following{/other_user}","gists_url":"https://api.github.com/users/matthewwithanm/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewwithanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewwithanm/subscriptions","organizations_url":"https://api.github.com/users/matthewwithanm/orgs","repos_url":"https://api.github.com/users/matthewwithanm/repos","events_url":"https://api.github.com/users/matthewwithanm/events{/privacy}","received_events_url":"https://api.github.com/users/matthewwithanm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react/labels/Component:%20DOM","name":"Component: DOM","color":"fef2c0"},{"url":"https://api.github.com/repos/facebook/react/labels/Type:%20Bug","name":"Type: Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2014-03-12T21:33:49Z","updated_at":"2016-09-11T04:41:42Z","closed_at":null,"body":"When using server rendering, putting an `<img>` in a `<noscript>` seems to invariably cause an invariant violation (it can't find the image).\r\n\r\nI believe this is because, to the JS enabled browser, the noscript content looks like CDATA.\r\n\r\nThis can be worked around by using `dangerouslySetInnerHTML` to actually set the contents to an HTML string, however, you can't nest components with this approach."},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/246161590","html_url":"https://github.com/facebook/react/issues/1252#issuecomment-246161590","issue_url":"https://api.github.com/repos/facebook/react/issues/1252","id":246161590,"user":{"login":"BabakMN","id":888936,"avatar_url":"https://avatars.githubusercontent.com/u/888936?v=3","gravatar_id":"","url":"https://api.github.com/users/BabakMN","html_url":"https://github.com/BabakMN","followers_url":"https://api.github.com/users/BabakMN/followers","following_url":"https://api.github.com/users/BabakMN/following{/other_user}","gists_url":"https://api.github.com/users/BabakMN/gists{/gist_id}","starred_url":"https://api.github.com/users/BabakMN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BabakMN/subscriptions","organizations_url":"https://api.github.com/users/BabakMN/orgs","repos_url":"https://api.github.com/users/BabakMN/repos","events_url":"https://api.github.com/users/BabakMN/events{/privacy}","received_events_url":"https://api.github.com/users/BabakMN/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T04:41:42Z","updated_at":"2016-09-11T04:41:42Z","body":"I think this issue should be highlighted somewhere on the documentation.\r\n\r\nThe following seems to work well for me both on client and server (thanks to people above):\r\n\r\n`Noscript.js`\r\n\r\n```js\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom/server';\r\n\r\n\r\nexport default function Noscript(props) {\r\n\r\n    // https://github.com/facebook/react/issues/1252\r\n\r\n    const staticMarkup = ReactDOM.renderToStaticMarkup(\r\n        props.children\r\n    );\r\n\r\n    return <noscript dangerouslySetInnerHTML={{ __html: staticMarkup }} />;\r\n\r\n}\r\n\r\n```\r\n\r\nUsage:\r\n\r\n```js\r\nimport Noscript from './Noscript.js';\r\n```\r\n\r\n```jsx\r\n<Noscript>\r\n   <div className=\"noJavascript\">\r\n      <div>\r\n         <p>\r\n         Your browser has disabled Javascript. Please note this website requires Javsacript to function correctly.\r\n         </p>\r\n      </div>\r\n   </div>\r\n</Noscript>\r\n```\r\n"}}
{"actor":{"display_login":"BabakMN"}}