{"action":"created","issue":{"url":"https://api.github.com/repos/developit/preact/issues/1014","repository_url":"https://api.github.com/repos/developit/preact","labels_url":"https://api.github.com/repos/developit/preact/issues/1014/labels{/name}","comments_url":"https://api.github.com/repos/developit/preact/issues/1014/comments","events_url":"https://api.github.com/repos/developit/preact/issues/1014/events","html_url":"https://github.com/developit/preact/issues/1014","id":299835848,"number":1014,"title":"Component renders fine when inline, <undefined/> when imported!","user":{"login":"izkrivera","id":477592,"avatar_url":"https://avatars2.githubusercontent.com/u/477592?v=4","gravatar_id":"","url":"https://api.github.com/users/izkrivera","html_url":"https://github.com/izkrivera","followers_url":"https://api.github.com/users/izkrivera/followers","following_url":"https://api.github.com/users/izkrivera/following{/other_user}","gists_url":"https://api.github.com/users/izkrivera/gists{/gist_id}","starred_url":"https://api.github.com/users/izkrivera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/izkrivera/subscriptions","organizations_url":"https://api.github.com/users/izkrivera/orgs","repos_url":"https://api.github.com/users/izkrivera/repos","events_url":"https://api.github.com/users/izkrivera/events{/privacy}","received_events_url":"https://api.github.com/users/izkrivera/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-23T20:11:16Z","updated_at":"2018-02-23T20:42:00Z","closed_at":"2018-02-23T20:42:00Z","author_association":"NONE","body":"So If I import this component from a table.js file:\r\n\r\n```\r\nimport { Component, h } from 'preact';\r\nexport default class Table extends Component {\r\n  render() {\r\n    return (\r\n      <table class=\"table\">\r\n        <thead>\r\n          <tr>\r\n            <th scope=\"col\">#</th>\r\n            <th scope=\"col\">First</th>\r\n            <th scope=\"col\">Last</th>\r\n            <th scope=\"col\">Handle</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr>\r\n            <th scope=\"row\">1</th>\r\n            <td>Mark</td>\r\n            <td>Otto</td>\r\n            <td>@mdo</td>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    );\r\n  }\r\n}\r\n```\r\n\r\nit renders `<undefined></undefined>`.\r\n\r\nBut if I paste the same component inline on the container, then the same code renders just fine:\r\n\r\n```\r\nclass Table extends Component {\r\n  render() {\r\n    return (\r\n      <table class=\"table\">\r\n        <thead>\r\n          <tr>\r\n            <th scope=\"col\">#</th>\r\n            <th scope=\"col\">First</th>\r\n            <th scope=\"col\">Last</th>\r\n            <th scope=\"col\">Handle</th>\r\n          </tr>\r\n        </thead>\r\n        <tbody>\r\n          <tr>\r\n            <th scope=\"row\">1</th>\r\n            <td>Mark</td>\r\n            <td>Otto</td>\r\n            <td>@mdo</td>\r\n          </tr>\r\n        </tbody>\r\n      </table>\r\n    );\r\n  }\r\n}\r\n\r\nexport default class Dashboard extends Component {\r\ngetContentForState() {\r\n    const { dashboard } = this.context.store.getState();\r\n    if (dashboard.requested.limit === 0) {\r\n      return (\r\n        <div class=\"row\">\r\n          <div class=\"col-sm-12\"><Preloader fixed={true} /></div>\r\n        </div>\r\n      );\r\n    } else {\r\n      return (\r\n        <div class=\"row\">\r\n          <div class=\"col-sm-12\">\r\n            <Table page={this.page} />\r\n          </div>\r\n          <div class=\"col-sm-12\">\r\n            <DashboardNavigation\r\n              offset={this.offset}\r\n              limit={this.limit}\r\n              total={this.quizCount}\r\n              nextAction={() => { this.nextPage(); }}\r\n              previousAction={() => { this.previousPage(); }}\r\n            />\r\n          </div>\r\n        </div>\r\n      );\r\n    }\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <div class=\"container\">{this.getContentForState()}</div>\r\n    );\r\n  }\r\n}\r\n```\r\n\r\nThe import version compiles fine and does not throw runtime errors other than rendering undefined.\r\n"},"comment":{"url":"https://api.github.com/repos/developit/preact/issues/comments/368132727","html_url":"https://github.com/developit/preact/issues/1014#issuecomment-368132727","issue_url":"https://api.github.com/repos/developit/preact/issues/1014","id":368132727,"user":{"login":"izkrivera","id":477592,"avatar_url":"https://avatars2.githubusercontent.com/u/477592?v=4","gravatar_id":"","url":"https://api.github.com/users/izkrivera","html_url":"https://github.com/izkrivera","followers_url":"https://api.github.com/users/izkrivera/followers","following_url":"https://api.github.com/users/izkrivera/following{/other_user}","gists_url":"https://api.github.com/users/izkrivera/gists{/gist_id}","starred_url":"https://api.github.com/users/izkrivera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/izkrivera/subscriptions","organizations_url":"https://api.github.com/users/izkrivera/orgs","repos_url":"https://api.github.com/users/izkrivera/repos","events_url":"https://api.github.com/users/izkrivera/events{/privacy}","received_events_url":"https://api.github.com/users/izkrivera/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T20:42:00Z","updated_at":"2018-02-23T20:42:00Z","author_association":"NONE","body":"Thanks. There was  a syntax error not caught by the compiler for some reason. Fixed."}}
{"actor":{"display_login":"izkrivera"}}