{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/polaris-react/pulls/comments/245108954","pull_request_review_id":189152076,"id":245108954,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTEwODk1NA==","diff_hunk":"@@ -369,6 +369,20 @@ describe('<ResourceList />', () => {\n         false,\n       );\n     });\n+\n+    it('renders on noninitial load when items are provided', () => {\n+      const resourceList = mountWithAppProvider(\n+        <ResourceList\n+          bulkActions={bulkActions}\n+          items={[]}\n+          renderItem={renderItem}\n+        />,\n+      );\n+      expect(findByTestID(resourceList, 'ResourceList-Header')).toHaveLength(0);\n+      resourceList.setProps({items: itemsWithID});\n+      resourceList.update();\n+      expect(findByTestID(resourceList, 'ResourceList-Header')).toHaveLength(1);","path":"src/components/ResourceList/tests/ResourceList.test.tsx","position":16,"original_position":16,"commit_id":"8f74dad99b9896344db5f171fc8508dc001195bc","original_commit_id":"8f74dad99b9896344db5f171fc8508dc001195bc","user":{"login":"solonaarmstrong","id":6239480,"node_id":"MDQ6VXNlcjYyMzk0ODA=","avatar_url":"https://avatars1.githubusercontent.com/u/6239480?v=4","gravatar_id":"","url":"https://api.github.com/users/solonaarmstrong","html_url":"https://github.com/solonaarmstrong","followers_url":"https://api.github.com/users/solonaarmstrong/followers","following_url":"https://api.github.com/users/solonaarmstrong/following{/other_user}","gists_url":"https://api.github.com/users/solonaarmstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/solonaarmstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solonaarmstrong/subscriptions","organizations_url":"https://api.github.com/users/solonaarmstrong/orgs","repos_url":"https://api.github.com/users/solonaarmstrong/repos","events_url":"https://api.github.com/users/solonaarmstrong/events{/privacy}","received_events_url":"https://api.github.com/users/solonaarmstrong/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n       expect(resourceListHeader).toHaveLength(1);\r\n```","created_at":"2019-01-03T19:34:10Z","updated_at":"2019-01-03T19:34:10Z","html_url":"https://github.com/Shopify/polaris-react/pull/747#discussion_r245108954","pull_request_url":"https://api.github.com/repos/Shopify/polaris-react/pulls/747","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Shopify/polaris-react/pulls/comments/245108954"},"html":{"href":"https://github.com/Shopify/polaris-react/pull/747#discussion_r245108954"},"pull_request":{"href":"https://api.github.com/repos/Shopify/polaris-react/pulls/747"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/polaris-react/pulls/747","id":238233747,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MjMzNzQ3","html_url":"https://github.com/Shopify/polaris-react/pull/747","diff_url":"https://github.com/Shopify/polaris-react/pull/747.diff","patch_url":"https://github.com/Shopify/polaris-react/pull/747.patch","issue_url":"https://api.github.com/repos/Shopify/polaris-react/issues/747","number":747,"state":"open","locked":false,"title":"[ResourceList] Fix heading not loading","user":{"login":"AndrewMusgrave","id":24610840,"node_id":"MDQ6VXNlcjI0NjEwODQw","avatar_url":"https://avatars0.githubusercontent.com/u/24610840?v=4","gravatar_id":"","url":"https://api.github.com/users/AndrewMusgrave","html_url":"https://github.com/AndrewMusgrave","followers_url":"https://api.github.com/users/AndrewMusgrave/followers","following_url":"https://api.github.com/users/AndrewMusgrave/following{/other_user}","gists_url":"https://api.github.com/users/AndrewMusgrave/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewMusgrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewMusgrave/subscriptions","organizations_url":"https://api.github.com/users/AndrewMusgrave/orgs","repos_url":"https://api.github.com/users/AndrewMusgrave/repos","events_url":"https://api.github.com/users/AndrewMusgrave/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewMusgrave/received_events","type":"User","site_admin":false},"body":"### WHY are these changes introduced?\r\nFixes #735\r\n\r\n### WHAT is this pull request doing?\r\nRemoving ref from state and make it a class property\r\n\r\n### How to 🎩\r\n\r\nThank you for the playground @andrewpye\r\n\r\n<details>\r\n<summary>Copy-paste this code in <code>playground/Playground.tsx</code>:</summary>\r\n\r\n```jsx\r\nimport React from 'react';\r\nimport {\r\n  Avatar,\r\n  Button,\r\n  Card,\r\n  Label,\r\n  List,\r\n  ResourceList,\r\n  Select,\r\n  TextStyle,\r\n  Page,\r\n} from '@shopify/polaris';\r\n\r\nconst initialItemList = [\r\n  {\r\n    id: 341,\r\n    url: 'customers/341',\r\n    name: 'Mae Jemison',\r\n    location: 'Decatur, USA',\r\n  },\r\n  {\r\n    id: 256,\r\n    url: 'customers/256',\r\n    name: 'Ellen Ochoa',\r\n    location: 'Los Angeles, USA',\r\n  },\r\n];\r\n\r\nexport default class ResourceListExample extends React.Component {\r\n  state = {\r\n    selectedItems: [],\r\n    items: [],\r\n  };\r\n\r\n  handleSelectionChange = (selectedItems) => {\r\n    this.setState({selectedItems});\r\n  };\r\n\r\n  addItems = () => {\r\n    this.setState({items: initialItemList});\r\n  };\r\n\r\n  renderItem = (item) => {\r\n    const {id, url, name, location} = item;\r\n    const media = <Avatar customer size=\"medium\" name={name} />;\r\n\r\n    return (\r\n      <ResourceList.Item\r\n        id={id}\r\n        url={url}\r\n        media={media}\r\n        accessibilityLabel={`View details for ${name}`}\r\n      >\r\n        <h3>\r\n          <TextStyle variation=\"strong\">{name}</TextStyle>\r\n        </h3>\r\n        <div>{location}</div>\r\n      </ResourceList.Item>\r\n    );\r\n  };\r\n\r\n  render() {\r\n    const resourceName = {\r\n      singular: 'customer',\r\n      plural: 'customers',\r\n    };\r\n\r\n    const {items = []} = this.state;\r\n\r\n    const promotedBulkActions = [\r\n      {\r\n        content: 'Edit customers',\r\n        onAction: () => console.log('Todo: implement bulk edit'),\r\n      },\r\n    ];\r\n\r\n    const bulkActions = [\r\n      {\r\n        content: 'Add tags',\r\n        onAction: () => console.log('Todo: implement bulk add tags'),\r\n      },\r\n      {\r\n        content: 'Remove tags',\r\n        onAction: () => console.log('Todo: implement bulk remove tags'),\r\n      },\r\n      {\r\n        content: 'Delete customers',\r\n        onAction: () => console.log('Todo: implement bulk delete'),\r\n      },\r\n    ];\r\n\r\n    return (\r\n      <Card title=\"Resource list header bug\">\r\n        <Card.Section title=\"When items are set in an update\">\r\n          <ResourceList\r\n            hasMoreItems\r\n            showHeader\r\n            sortOptions={['asdf']}\r\n            resourceName={resourceName}\r\n            renderItem={this.renderItem}\r\n            selectedItems={this.state.selectedItems}\r\n            onSelectionChange={this.handleSelectionChange}\r\n            promotedBulkActions={promotedBulkActions}\r\n            bulkActions={bulkActions}\r\n            items={items}\r\n          />\r\n          <Button onClick={this.addItems}>Populate list</Button>\r\n        </Card.Section>\r\n      </Card>\r\n    );\r\n  }\r\n}\r\n```\r\n\r\n</details>\r\n","created_at":"2018-12-13T01:05:48Z","updated_at":"2019-01-03T19:34:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"915d1af2028ce0233bf4c859c86d7b78be3a252c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dleroux","id":1229901,"node_id":"MDQ6VXNlcjEyMjk5MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1229901?v=4","gravatar_id":"","url":"https://api.github.com/users/dleroux","html_url":"https://github.com/dleroux","followers_url":"https://api.github.com/users/dleroux/followers","following_url":"https://api.github.com/users/dleroux/following{/other_user}","gists_url":"https://api.github.com/users/dleroux/gists{/gist_id}","starred_url":"https://api.github.com/users/dleroux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dleroux/subscriptions","organizations_url":"https://api.github.com/users/dleroux/orgs","repos_url":"https://api.github.com/users/dleroux/repos","events_url":"https://api.github.com/users/dleroux/events{/privacy}","received_events_url":"https://api.github.com/users/dleroux/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/polaris-react/pulls/747/commits","review_comments_url":"https://api.github.com/repos/Shopify/polaris-react/pulls/747/comments","review_comment_url":"https://api.github.com/repos/Shopify/polaris-react/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/polaris-react/issues/747/comments","statuses_url":"https://api.github.com/repos/Shopify/polaris-react/statuses/8f74dad99b9896344db5f171fc8508dc001195bc","head":{"label":"Shopify:rl-fix-ref","ref":"rl-fix-ref","sha":"8f74dad99b9896344db5f171fc8508dc001195bc","user":{"login":"Shopify","id":8085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwODU=","avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":88897663,"node_id":"MDEwOlJlcG9zaXRvcnk4ODg5NzY2Mw==","name":"polaris-react","full_name":"Shopify/polaris-react","private":false,"owner":{"login":"Shopify","id":8085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwODU=","avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Shopify/polaris-react","description":"Shopify’s product component library","fork":false,"url":"https://api.github.com/repos/Shopify/polaris-react","forks_url":"https://api.github.com/repos/Shopify/polaris-react/forks","keys_url":"https://api.github.com/repos/Shopify/polaris-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/polaris-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/polaris-react/teams","hooks_url":"https://api.github.com/repos/Shopify/polaris-react/hooks","issue_events_url":"https://api.github.com/repos/Shopify/polaris-react/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/polaris-react/events","assignees_url":"https://api.github.com/repos/Shopify/polaris-react/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/polaris-react/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/polaris-react/tags","blobs_url":"https://api.github.com/repos/Shopify/polaris-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/polaris-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/polaris-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/polaris-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/polaris-react/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/polaris-react/languages","stargazers_url":"https://api.github.com/repos/Shopify/polaris-react/stargazers","contributors_url":"https://api.github.com/repos/Shopify/polaris-react/contributors","subscribers_url":"https://api.github.com/repos/Shopify/polaris-react/subscribers","subscription_url":"https://api.github.com/repos/Shopify/polaris-react/subscription","commits_url":"https://api.github.com/repos/Shopify/polaris-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/polaris-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/polaris-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/polaris-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/polaris-react/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/polaris-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/polaris-react/merges","archive_url":"https://api.github.com/repos/Shopify/polaris-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/polaris-react/downloads","issues_url":"https://api.github.com/repos/Shopify/polaris-react/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/polaris-react/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/polaris-react/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/polaris-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/polaris-react/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/polaris-react/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/polaris-react/deployments","created_at":"2017-04-20T18:26:34Z","updated_at":"2019-01-03T18:02:02Z","pushed_at":"2019-01-03T19:28:17Z","git_url":"git://github.com/Shopify/polaris-react.git","ssh_url":"git@github.com:Shopify/polaris-react.git","clone_url":"https://github.com/Shopify/polaris-react.git","svn_url":"https://github.com/Shopify/polaris-react","homepage":"https://polaris.shopify.com","size":10279,"stargazers_count":2104,"watchers_count":2104,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":325,"mirror_url":null,"archived":false,"open_issues_count":138,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":325,"open_issues":138,"watchers":2104,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"787b3dc752fd757d85f4f08974cab551a1880467","user":{"login":"Shopify","id":8085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwODU=","avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":88897663,"node_id":"MDEwOlJlcG9zaXRvcnk4ODg5NzY2Mw==","name":"polaris-react","full_name":"Shopify/polaris-react","private":false,"owner":{"login":"Shopify","id":8085,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwODU=","avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Shopify/polaris-react","description":"Shopify’s product component library","fork":false,"url":"https://api.github.com/repos/Shopify/polaris-react","forks_url":"https://api.github.com/repos/Shopify/polaris-react/forks","keys_url":"https://api.github.com/repos/Shopify/polaris-react/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/polaris-react/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/polaris-react/teams","hooks_url":"https://api.github.com/repos/Shopify/polaris-react/hooks","issue_events_url":"https://api.github.com/repos/Shopify/polaris-react/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/polaris-react/events","assignees_url":"https://api.github.com/repos/Shopify/polaris-react/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/polaris-react/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/polaris-react/tags","blobs_url":"https://api.github.com/repos/Shopify/polaris-react/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/polaris-react/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/polaris-react/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/polaris-react/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/polaris-react/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/polaris-react/languages","stargazers_url":"https://api.github.com/repos/Shopify/polaris-react/stargazers","contributors_url":"https://api.github.com/repos/Shopify/polaris-react/contributors","subscribers_url":"https://api.github.com/repos/Shopify/polaris-react/subscribers","subscription_url":"https://api.github.com/repos/Shopify/polaris-react/subscription","commits_url":"https://api.github.com/repos/Shopify/polaris-react/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/polaris-react/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/polaris-react/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/polaris-react/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/polaris-react/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/polaris-react/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/polaris-react/merges","archive_url":"https://api.github.com/repos/Shopify/polaris-react/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/polaris-react/downloads","issues_url":"https://api.github.com/repos/Shopify/polaris-react/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/polaris-react/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/polaris-react/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/polaris-react/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/polaris-react/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/polaris-react/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/polaris-react/deployments","created_at":"2017-04-20T18:26:34Z","updated_at":"2019-01-03T18:02:02Z","pushed_at":"2019-01-03T19:28:17Z","git_url":"git://github.com/Shopify/polaris-react.git","ssh_url":"git@github.com:Shopify/polaris-react.git","clone_url":"https://github.com/Shopify/polaris-react.git","svn_url":"https://github.com/Shopify/polaris-react","homepage":"https://polaris.shopify.com","size":10279,"stargazers_count":2104,"watchers_count":2104,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":325,"mirror_url":null,"archived":false,"open_issues_count":138,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":325,"open_issues":138,"watchers":2104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/polaris-react/pulls/747"},"html":{"href":"https://github.com/Shopify/polaris-react/pull/747"},"issue":{"href":"https://api.github.com/repos/Shopify/polaris-react/issues/747"},"comments":{"href":"https://api.github.com/repos/Shopify/polaris-react/issues/747/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/polaris-react/pulls/747/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/polaris-react/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/polaris-react/pulls/747/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/polaris-react/statuses/8f74dad99b9896344db5f171fc8508dc001195bc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"solonaarmstrong"}}