{"action":"opened","issue":{"url":"https://api.github.com/repos/TrueCar/react-launch-darkly/issues/85","repository_url":"https://api.github.com/repos/TrueCar/react-launch-darkly","labels_url":"https://api.github.com/repos/TrueCar/react-launch-darkly/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/TrueCar/react-launch-darkly/issues/85/comments","events_url":"https://api.github.com/repos/TrueCar/react-launch-darkly/issues/85/events","html_url":"https://github.com/TrueCar/react-launch-darkly/issues/85","id":373498486,"node_id":"MDU6SXNzdWUzNzM0OTg0ODY=","number":85,"title":"Children render callback","user":{"login":"HHogg","id":7130591,"node_id":"MDQ6VXNlcjcxMzA1OTE=","avatar_url":"https://avatars0.githubusercontent.com/u/7130591?v=4","gravatar_id":"","url":"https://api.github.com/users/HHogg","html_url":"https://github.com/HHogg","followers_url":"https://api.github.com/users/HHogg/followers","following_url":"https://api.github.com/users/HHogg/following{/other_user}","gists_url":"https://api.github.com/users/HHogg/gists{/gist_id}","starred_url":"https://api.github.com/users/HHogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HHogg/subscriptions","organizations_url":"https://api.github.com/users/HHogg/orgs","repos_url":"https://api.github.com/users/HHogg/repos","events_url":"https://api.github.com/users/HHogg/events{/privacy}","received_events_url":"https://api.github.com/users/HHogg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-24T13:59:57Z","updated_at":"2018-10-24T13:59:57Z","closed_at":null,"author_association":"NONE","body":"Hi, would you be open to a PR that allows the render callback to be passed in as the `children` prop? This would allow people to keep the render logic together inside the render function.\r\n\r\nThe API for boolean, I imagine it being like is something like...\r\n\r\n```jsx\r\nrender() {\r\n  return (\r\n    <FeatureFlag key=\"Feature1\">\r\n      { (value) => value \r\n        ? <Feature1Component /> \r\n        : <FallbackRenderComponent />\r\n      }\r\n    </FeatureFlag>\r\n  );\r\n}\r\n```\r\n\r\nAnd this would also work for multivariant flags too...\r\n\r\n```jsx\r\nrender() {\r\n  return (\r\n    <FeatureFlag key=\"Feature1\">\r\n      { (value) => {\r\n        switch (value) {\r\n          case 1: return <Feature1Case1 />\r\n          case 2: return <Feature1Case1 />\r\n        }\r\n      } }\r\n    </FeatureFlag>\r\n  );\r\n}\r\n```\r\n\r\nAs FeatureFlag doesn't support any children at the moment, then it would not be a breaking change and could just be given the value. "}}
{"actor":{"display_login":"HHogg"}}