{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/reactjs.org/issues/1405","repository_url":"https://api.github.com/repos/reactjs/reactjs.org","labels_url":"https://api.github.com/repos/reactjs/reactjs.org/issues/1405/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/reactjs.org/issues/1405/comments","events_url":"https://api.github.com/repos/reactjs/reactjs.org/issues/1405/events","html_url":"https://github.com/reactjs/reactjs.org/pull/1405","id":381918828,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNzYyNjAy","number":1405,"title":"Update Hooks Intro Example() to `import React`","user":{"login":"jsjoeio","id":3806031,"node_id":"MDQ6VXNlcjM4MDYwMzE=","avatar_url":"https://avatars3.githubusercontent.com/u/3806031?v=4","gravatar_id":"","url":"https://api.github.com/users/jsjoeio","html_url":"https://github.com/jsjoeio","followers_url":"https://api.github.com/users/jsjoeio/followers","following_url":"https://api.github.com/users/jsjoeio/following{/other_user}","gists_url":"https://api.github.com/users/jsjoeio/gists{/gist_id}","starred_url":"https://api.github.com/users/jsjoeio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsjoeio/subscriptions","organizations_url":"https://api.github.com/users/jsjoeio/orgs","repos_url":"https://api.github.com/users/jsjoeio/repos","events_url":"https://api.github.com/users/jsjoeio/events{/privacy}","received_events_url":"https://api.github.com/users/jsjoeio/received_events","type":"User","site_admin":false},"labels":[{"id":712729626,"node_id":"MDU6TGFiZWw3MTI3Mjk2MjY=","url":"https://api.github.com/repos/reactjs/reactjs.org/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-18T01:38:11Z","updated_at":"2018-11-18T01:49:51Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/reactjs/reactjs.org/pulls/1405","html_url":"https://github.com/reactjs/reactjs.org/pull/1405","diff_url":"https://github.com/reactjs/reactjs.org/pull/1405.diff","patch_url":"https://github.com/reactjs/reactjs.org/pull/1405.patch"},"body":"Hi there! 👋 \r\n\r\nI was trying to test out Hooks for fun (cheers to the React team!). I copied the first example into my project and tried exporting that function to use as a component in another component and kept getting this error `Uncaught ReferenceError: React is not defined`.\r\n\r\nI realized it was because I wasn't import `React` along with the `useState` hook.\r\n\r\nSo, I thought I would propose this change to update the example to import React so that future readers don't run into the same error.\r\n\r\n\r\n\r\n<!--\r\n\r\nThank you for the PR! Contributors like you keep React awesome!\r\n\r\nPlease see the Contribution Guide for guidelines:\r\n\r\nhttps://github.com/reactjs/reactjs.org/blob/master/CONTRIBUTING.md\r\n\r\nIf your PR references an existing issue, please add the issue number below\r\n\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/reactjs/reactjs.org/issues/comments/439661246","html_url":"https://github.com/reactjs/reactjs.org/pull/1405#issuecomment-439661246","issue_url":"https://api.github.com/repos/reactjs/reactjs.org/issues/1405","id":439661246,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTY2MTI0Ng==","user":{"login":"facebook-github-bot","id":6422482,"node_id":"MDQ6VXNlcjY0MjI0ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/6422482?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook-github-bot","html_url":"https://github.com/facebook-github-bot","followers_url":"https://api.github.com/users/facebook-github-bot/followers","following_url":"https://api.github.com/users/facebook-github-bot/following{/other_user}","gists_url":"https://api.github.com/users/facebook-github-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook-github-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook-github-bot/subscriptions","organizations_url":"https://api.github.com/users/facebook-github-bot/orgs","repos_url":"https://api.github.com/users/facebook-github-bot/repos","events_url":"https://api.github.com/users/facebook-github-bot/events{/privacy}","received_events_url":"https://api.github.com/users/facebook-github-bot/received_events","type":"User","site_admin":false},"created_at":"2018-11-18T01:49:51Z","updated_at":"2018-11-18T01:49:51Z","author_association":"COLLABORATOR","body":"Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!"}}
{"actor":{"display_login":"facebook-github-bot"}}