{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/react-instantsearch/issues/266","repository_url":"https://api.github.com/repos/algolia/react-instantsearch","labels_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/266/comments","events_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/266/events","html_url":"https://github.com/algolia/react-instantsearch/pull/266","id":251257089,"number":266,"title":"[RFC] Adds support for any type of renderable element in List component","user":{"login":"mschinis","id":771903,"avatar_url":"https://avatars2.githubusercontent.com/u/771903?v=4","gravatar_id":"","url":"https://api.github.com/users/mschinis","html_url":"https://github.com/mschinis","followers_url":"https://api.github.com/users/mschinis/followers","following_url":"https://api.github.com/users/mschinis/following{/other_user}","gists_url":"https://api.github.com/users/mschinis/gists{/gist_id}","starred_url":"https://api.github.com/users/mschinis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschinis/subscriptions","organizations_url":"https://api.github.com/users/mschinis/orgs","repos_url":"https://api.github.com/users/mschinis/repos","events_url":"https://api.github.com/users/mschinis/events{/privacy}","received_events_url":"https://api.github.com/users/mschinis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-18T14:10:03Z","updated_at":"2017-08-24T13:17:30Z","closed_at":"2017-08-21T08:37:28Z","pull_request":{"url":"https://api.github.com/repos/algolia/react-instantsearch/pulls/266","html_url":"https://github.com/algolia/react-instantsearch/pull/266","diff_url":"https://github.com/algolia/react-instantsearch/pull/266.diff","patch_url":"https://github.com/algolia/react-instantsearch/pull/266.patch"},"body":"**Summary**\r\nI have been using the `<MultiRange />` like this:\r\n\r\n```jsx\r\n<MultiRange\r\n  attributeName=\"computed_price\"\r\n  items={[\r\n    {\r\n      end: 10,\r\n      label: [\r\n        <span key={0}>&lt; </span>,\r\n        <Price key={1} pence={1000} displayCurrency=\"GBP\" />\r\n      ]\r\n    },\r\n    {\r\n      start: 10,\r\n      end: 100,\r\n      label: [\r\n        <Price key={0} pence={1000} displayCurrency=\"GBP\" />,\r\n        <span key={1}> - </span>,\r\n        <Price key={2} pence={10000} displayCurrency=\"GBP\" />\r\n      ]\r\n    },\r\n    {\r\n      start: 100,\r\n      end: 500,\r\n      label: [\r\n        <Price key={0} pence={10000} displayCurrency=\"GBP\" />,\r\n        <span key={1}> - </span>,\r\n        <Price key={2} pence={50000} displayCurrency=\"GBP\" />\r\n      ]\r\n    },\r\n    {\r\n      start: 500,\r\n      label: [\r\n        <span key={0}> &gt; </span>,\r\n        <Price key={1} pence={50000} displayCurrency=\"GBP\" />\r\n      ]\r\n    }\r\n  ]}\r\n/>\r\n```\r\n\r\nAccording to the propTypes, defined in the MultiRange component, it's meant to accept any renderable element ([`PropTypes.node`](https://github.com/algolia/react-instantsearch/blob/master/packages/react-instantsearch/src/components/MultiRange.js#L13))\r\n\r\nUsing the component like mentioned above, would throw a proptypes validation error of:\r\n```\r\nWarning: Failed prop type: Invalid prop `items[0].label` of type `array` supplied to `List`, expected `string`.\r\n    in List (created by MultiRange)\r\n    in MultiRange (created by Translatable(MultiRange))\r\n```\r\n\r\nDigging further, the `MultiRange` component uses the `List` component whose propTypes [don't match the same propTypes](https://github.com/algolia/react-instantsearch/blob/master/packages/react-instantsearch/src/components/List.js#L8)\r\n\r\n**Result**\r\n\r\nThe updated propTypes remove the warning from showing up. Accepting a `node` here makes sense, as it wouldn't start throwing any other warning in other components, whatever is passed to it, as long as it is an item that can be rendered.\r\n\r\n**Related**\r\n\r\nhttps://github.com/algolia/react-instantsearch/issues/102"},"comment":{"url":"https://api.github.com/repos/algolia/react-instantsearch/issues/comments/324631883","html_url":"https://github.com/algolia/react-instantsearch/pull/266#issuecomment-324631883","issue_url":"https://api.github.com/repos/algolia/react-instantsearch/issues/266","id":324631883,"user":{"login":"mschinis","id":771903,"avatar_url":"https://avatars2.githubusercontent.com/u/771903?v=4","gravatar_id":"","url":"https://api.github.com/users/mschinis","html_url":"https://github.com/mschinis","followers_url":"https://api.github.com/users/mschinis/followers","following_url":"https://api.github.com/users/mschinis/following{/other_user}","gists_url":"https://api.github.com/users/mschinis/gists{/gist_id}","starred_url":"https://api.github.com/users/mschinis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschinis/subscriptions","organizations_url":"https://api.github.com/users/mschinis/orgs","repos_url":"https://api.github.com/users/mschinis/repos","events_url":"https://api.github.com/users/mschinis/events{/privacy}","received_events_url":"https://api.github.com/users/mschinis/received_events","type":"User","site_admin":false},"created_at":"2017-08-24T13:17:30Z","updated_at":"2017-08-24T13:17:30Z","body":"@mthuret any chance you can release a new version of the library containing the above fix?\r\nI'm eager to remove the warning from my console without setting the dependency to master 😁"}}
{"actor":{"display_login":"mschinis"}}