{"action":"created","issue":{"url":"https://api.github.com/repos/hallister/semantic-react/issues/49","repository_url":"https://api.github.com/repos/hallister/semantic-react","labels_url":"https://api.github.com/repos/hallister/semantic-react/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/hallister/semantic-react/issues/49/comments","events_url":"https://api.github.com/repos/hallister/semantic-react/issues/49/events","html_url":"https://github.com/hallister/semantic-react/issues/49","id":139458856,"number":49,"title":"Input label- and icon-props","user":{"login":"aphofstede","id":701218,"avatar_url":"https://avatars.githubusercontent.com/u/701218?v=3","gravatar_id":"","url":"https://api.github.com/users/aphofstede","html_url":"https://github.com/aphofstede","followers_url":"https://api.github.com/users/aphofstede/followers","following_url":"https://api.github.com/users/aphofstede/following{/other_user}","gists_url":"https://api.github.com/users/aphofstede/gists{/gist_id}","starred_url":"https://api.github.com/users/aphofstede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aphofstede/subscriptions","organizations_url":"https://api.github.com/users/aphofstede/orgs","repos_url":"https://api.github.com/users/aphofstede/repos","events_url":"https://api.github.com/users/aphofstede/events{/privacy}","received_events_url":"https://api.github.com/users/aphofstede/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-09T02:46:17Z","updated_at":"2016-04-09T19:51:28Z","closed_at":"2016-04-09T19:51:28Z","body":"The Input component has `labeled` and `icon` props; which are actually not used, but set automatically to true if you add a `Label` or `Icon` component as a child.\r\nIn the property definition (`propTypes` field) though, they are defined as being `bool` or `string`, which implies different possibilities for interacting with the component. \r\n\r\nWhich interaction / paradigm do we want here? Do we want to encourage a certain way of setting up your hierarchy?\r\n\r\nI see a couple of options:\r\n\r\n- No properties exposed. The `Input` component looks at its children and does some magic based on what it finds. (We should remove the props from `propTypes` then)\r\n- Bool properties exposed and enforced. e.g. If you set `labeled` to true, you **must** put a `<Label/>` in the children.\r\n- String props exposed. e.g. `<Input icon=\"cloud\"/>` would automagically become `<Input><Icon name=\"cloud\"/></Input>`\r\n- Label, Icon (and Button) defined through props. Input should accept all props that these subcomponents do, and you can just set them on `<Input />`. (Note: You'll get clashes for some, like `name`)\r\n- A combination of the above / allow multiple ways of setting things up.\r\n\r\nNote: In a [recent PR](https://github.com/hallister/semantic-react/pull/45), support for a Button child was added; I chose the first option for that case..\r\nWe might want to think about making whatever gets decided a more recurring pattern in the component usage."},"comment":{"url":"https://api.github.com/repos/hallister/semantic-react/issues/comments/207843380","html_url":"https://github.com/hallister/semantic-react/issues/49#issuecomment-207843380","issue_url":"https://api.github.com/repos/hallister/semantic-react/issues/49","id":207843380,"user":{"login":"asvetliakov","id":8881674,"avatar_url":"https://avatars.githubusercontent.com/u/8881674?v=3","gravatar_id":"","url":"https://api.github.com/users/asvetliakov","html_url":"https://github.com/asvetliakov","followers_url":"https://api.github.com/users/asvetliakov/followers","following_url":"https://api.github.com/users/asvetliakov/following{/other_user}","gists_url":"https://api.github.com/users/asvetliakov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetliakov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetliakov/subscriptions","organizations_url":"https://api.github.com/users/asvetliakov/orgs","repos_url":"https://api.github.com/users/asvetliakov/repos","events_url":"https://api.github.com/users/asvetliakov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetliakov/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T19:51:28Z","updated_at":"2016-04-09T19:51:28Z","body":"Some stuff had been done in https://github.com/hallister/semantic-react/pull/71 and https://github.com/hallister/semantic-react/pull/70"}}