{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/react/issues/12733","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/12733/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/12733/comments","events_url":"https://api.github.com/repos/facebook/react/issues/12733/events","html_url":"https://github.com/facebook/react/issues/12733","id":319655070,"number":12733,"title":"Why are the Consumer and Provider properties of Consumer?","user":{"login":"ackvf","id":2313018,"avatar_url":"https://avatars1.githubusercontent.com/u/2313018?v=4","gravatar_id":"","url":"https://api.github.com/users/ackvf","html_url":"https://github.com/ackvf","followers_url":"https://api.github.com/users/ackvf/followers","following_url":"https://api.github.com/users/ackvf/following{/other_user}","gists_url":"https://api.github.com/users/ackvf/gists{/gist_id}","starred_url":"https://api.github.com/users/ackvf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ackvf/subscriptions","organizations_url":"https://api.github.com/users/ackvf/orgs","repos_url":"https://api.github.com/users/ackvf/repos","events_url":"https://api.github.com/users/ackvf/events{/privacy}","received_events_url":"https://api.github.com/users/ackvf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-02T18:03:56Z","updated_at":"2018-05-02T18:03:56Z","closed_at":null,"author_association":"NONE","body":"Is there a higher meaning for 1) `Consumer` and `Provider` both being properties of `Consumer`?\r\n2) And `Consumer` being of type `Symbol(react.context)` _(and not react.consumer)_ while `Provider` is of type `Symbol(react.provider)`?\r\n\r\n```jsx\r\nconst MyContext = React.createContext('value')\r\nMyContext === MyContext.Consumer === MyContext.Consumer.Consumer\r\n```\r\n\r\nWhile this _**IS**_ **convenient**, because I usually only use Provider once as\r\n```jsx\r\nimport MyContext from './MyContext'\r\n\r\n<MyContext.Provider>\r\n  ...\r\n</MyContext.Provider>\r\n```\r\n... and then I can do less typing by simply using, \r\n```jsx\r\nimport MyContext from './MyContext'\r\n\r\n<MyContext>\r\n  ...\r\n</MyContext>\r\n```\r\n\r\nI would be interested in knowing where _(if)_ this is documented and what is the preferred way? Whether to use the full `<MyContext.Consumer>` or if it is legit to just simplify to `<MyContext>`."}}
{"actor":{"display_login":"ackvf"}}