{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-docgen/issues/99","repository_url":"https://api.github.com/repos/reactjs/react-docgen","labels_url":"https://api.github.com/repos/reactjs/react-docgen/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-docgen/issues/99/comments","events_url":"https://api.github.com/repos/reactjs/react-docgen/issues/99/events","html_url":"https://github.com/reactjs/react-docgen/pull/99","id":167088085,"number":99,"title":"Check for import declaration type when getting default values, resolves #63","user":{"login":"nathanmarks","id":4420103,"avatar_url":"https://avatars.githubusercontent.com/u/4420103?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanmarks","html_url":"https://github.com/nathanmarks","followers_url":"https://api.github.com/users/nathanmarks/followers","following_url":"https://api.github.com/users/nathanmarks/following{/other_user}","gists_url":"https://api.github.com/users/nathanmarks/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanmarks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanmarks/subscriptions","organizations_url":"https://api.github.com/users/nathanmarks/orgs","repos_url":"https://api.github.com/users/nathanmarks/repos","events_url":"https://api.github.com/users/nathanmarks/events{/privacy}","received_events_url":"https://api.github.com/users/nathanmarks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-22T16:57:10Z","updated_at":"2016-08-02T15:44:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/reactjs/react-docgen/pulls/99","html_url":"https://github.com/reactjs/react-docgen/pull/99","diff_url":"https://github.com/reactjs/react-docgen/pull/99.diff","patch_url":"https://github.com/reactjs/react-docgen/pull/99.patch"},"body":"A common pattern in libraries is to set a default prop value as an imported component, for eg. a transition component for a dialog.\r\n\r\n#63 has an example + a workaround (not the most elegant however, involves using a functional component to return the default component).\r\n\r\nRight now, `react-docgen` throws an error on components implementing this pattern as `ImportDefaultDeclaration` is not a printable type.\r\n\r\nThis PR adds a conditional after the `resolveToValue(path)` call in `getDefaultValue(path)` to check if the node is an import declaration. If so, it returns the `.name` property of the original node (so the function/component name).\r\n"},"comment":{"url":"https://api.github.com/repos/reactjs/react-docgen/issues/comments/236946563","html_url":"https://github.com/reactjs/react-docgen/pull/99#issuecomment-236946563","issue_url":"https://api.github.com/repos/reactjs/react-docgen/issues/99","id":236946563,"user":{"login":"fkling","id":179026,"avatar_url":"https://avatars.githubusercontent.com/u/179026?v=3","gravatar_id":"","url":"https://api.github.com/users/fkling","html_url":"https://github.com/fkling","followers_url":"https://api.github.com/users/fkling/followers","following_url":"https://api.github.com/users/fkling/following{/other_user}","gists_url":"https://api.github.com/users/fkling/gists{/gist_id}","starred_url":"https://api.github.com/users/fkling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkling/subscriptions","organizations_url":"https://api.github.com/users/fkling/orgs","repos_url":"https://api.github.com/users/fkling/repos","events_url":"https://api.github.com/users/fkling/events{/privacy}","received_events_url":"https://api.github.com/users/fkling/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T15:44:59Z","updated_at":"2016-08-02T15:44:59Z","body":"yeah, this looks good to me. I was wondering if it makes sense to include some additional information about the origin of the value (e.g. that it is the default import of the `./ImportedComponent` module), but I'm not sure where / how."}}
{"actor":{"display_login":"fkling"}}