{"action":"opened","issue":{"url":"https://api.github.com/repos/LonelyLiaR/eatrc/issues/2","repository_url":"https://api.github.com/repos/LonelyLiaR/eatrc","labels_url":"https://api.github.com/repos/LonelyLiaR/eatrc/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/LonelyLiaR/eatrc/issues/2/comments","events_url":"https://api.github.com/repos/LonelyLiaR/eatrc/issues/2/events","html_url":"https://github.com/LonelyLiaR/eatrc/issues/2","id":309598970,"number":2,"title":"Custom component","user":{"login":"LonelyLiaR","id":12504732,"avatar_url":"https://avatars0.githubusercontent.com/u/12504732?v=4","gravatar_id":"","url":"https://api.github.com/users/LonelyLiaR","html_url":"https://github.com/LonelyLiaR","followers_url":"https://api.github.com/users/LonelyLiaR/followers","following_url":"https://api.github.com/users/LonelyLiaR/following{/other_user}","gists_url":"https://api.github.com/users/LonelyLiaR/gists{/gist_id}","starred_url":"https://api.github.com/users/LonelyLiaR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LonelyLiaR/subscriptions","organizations_url":"https://api.github.com/users/LonelyLiaR/orgs","repos_url":"https://api.github.com/users/LonelyLiaR/repos","events_url":"https://api.github.com/users/LonelyLiaR/events{/privacy}","received_events_url":"https://api.github.com/users/LonelyLiaR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-29T02:44:35Z","updated_at":"2018-03-29T02:44:35Z","closed_at":null,"author_association":"OWNER","body":"在写 **ReactDOM.render** 之前. 先来试着写一个自定义组件, 看看用之前写的JSX解析方法会得出什么样的结果:\r\n\r\n**custom.jsx**\r\n```jsx\r\nimport React from \"./react\";  // 引入 React.createElement 来解析JSX.\r\n\r\nexport default class {\r\n  render() {\r\n    return <div class=\"custom\" />;\r\n  }\r\n}\r\n```\r\n\r\nReact 自定义组件的途径是定义一个普通的 JavaScript 类.\r\n在这里我使用了 ES6 的 classes(类) API 来定义组件.\r\n不使用 ES6 的情况下, 可以使用 **create-react-class** 方法来定义组件."}}
{"actor":{"display_login":"LonelyLiaR"}}