{"action":"created","comment":{"url":"https://api.github.com/repos/developit/preact-compat/pulls/comments/71882007","id":71882007,"diff_hunk":"@@ -129,11 +129,40 @@ for (let i=ELEMENTS.length; i--; ) {\n }\n \n \n+function isStatelessComponent(c) {\n+\treturn typeof c === 'function' && !(c.prototype instanceof Component);\n+}\n+\n+\n+function statelessComponentHook(WrappedComponent) {\n+\t// Ensure the displayName has been set for debugging purposes\n+\tWrappedComponent.displayName = WrappedComponent.displayName\n+\t\t|| WrappedComponent.name\n+\t\t|| 'StatelessComponent';\n+\n+\tfunction StatelessComponent(props) {\n+\t\t// Ensure default props have been applied to the props.\n+\t\tconst p = WrappedComponent.defaultProps","path":"src/index.js","position":17,"original_position":17,"commit_id":"ba38e00145306b29688434532bf251668dfc3c9e","original_commit_id":"ba38e00145306b29688434532bf251668dfc3c9e","user":{"login":"developit","id":105127,"avatar_url":"https://avatars.githubusercontent.com/u/105127?v=3","gravatar_id":"","url":"https://api.github.com/users/developit","html_url":"https://github.com/developit","followers_url":"https://api.github.com/users/developit/followers","following_url":"https://api.github.com/users/developit/following{/other_user}","gists_url":"https://api.github.com/users/developit/gists{/gist_id}","starred_url":"https://api.github.com/users/developit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developit/subscriptions","organizations_url":"https://api.github.com/users/developit/orgs","repos_url":"https://api.github.com/users/developit/repos","events_url":"https://api.github.com/users/developit/events{/privacy}","received_events_url":"https://api.github.com/users/developit/received_events","type":"User","site_admin":false},"body":"I believe defaultProps should already be applied by this point - stateless functions are invoked [here](https://github.com/developit/preact/blob/master/src/vdom/functional-component.js#L24), and their props are mutated prior to invocation [here](https://github.com/developit/preact/blob/master/src/vdom/index.js#L36-L45), which seems to apply `defaultProps`.\r\n\r\nThoughts?\r\n\r\n-edit-: also, we'll want to also forward the second argument (`context`) through `StatelessComponent`, just passing it directly to `WrappedComponent`.","created_at":"2016-07-22T13:55:10Z","updated_at":"2016-07-22T13:55:10Z","html_url":"https://github.com/developit/preact-compat/pull/128#discussion_r71882007","pull_request_url":"https://api.github.com/repos/developit/preact-compat/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/developit/preact-compat/pulls/comments/71882007"},"html":{"href":"https://github.com/developit/preact-compat/pull/128#discussion_r71882007"},"pull_request":{"href":"https://api.github.com/repos/developit/preact-compat/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/developit/preact-compat/pulls/128","id":78479648,"html_url":"https://github.com/developit/preact-compat/pull/128","diff_url":"https://github.com/developit/preact-compat/pull/128.diff","patch_url":"https://github.com/developit/preact-compat/pull/128.patch","issue_url":"https://api.github.com/repos/developit/preact-compat/issues/128","number":128,"state":"open","locked":false,"title":"PropType fixes: Stateless component validation & softening validation to warnings","user":{"login":"ctrlplusb","id":12164768,"avatar_url":"https://avatars.githubusercontent.com/u/12164768?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlplusb","html_url":"https://github.com/ctrlplusb","followers_url":"https://api.github.com/users/ctrlplusb/followers","following_url":"https://api.github.com/users/ctrlplusb/following{/other_user}","gists_url":"https://api.github.com/users/ctrlplusb/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlplusb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlplusb/subscriptions","organizations_url":"https://api.github.com/users/ctrlplusb/orgs","repos_url":"https://api.github.com/users/ctrlplusb/repos","events_url":"https://api.github.com/users/ctrlplusb/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlplusb/received_events","type":"User","site_admin":false},"body":"Fixes #124 and #125 \r\n\r\nI accidentally messed up my previous PR commits.  So just recreated a new cleaned up one.","created_at":"2016-07-22T13:48:09Z","updated_at":"2016-07-22T13:55:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f72436c0c127686721eed8cbca32d2939513dbf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/developit/preact-compat/pulls/128/commits","review_comments_url":"https://api.github.com/repos/developit/preact-compat/pulls/128/comments","review_comment_url":"https://api.github.com/repos/developit/preact-compat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/developit/preact-compat/issues/128/comments","statuses_url":"https://api.github.com/repos/developit/preact-compat/statuses/ba38e00145306b29688434532bf251668dfc3c9e","head":{"label":"ctrlplusb:master","ref":"master","sha":"ba38e00145306b29688434532bf251668dfc3c9e","user":{"login":"ctrlplusb","id":12164768,"avatar_url":"https://avatars.githubusercontent.com/u/12164768?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlplusb","html_url":"https://github.com/ctrlplusb","followers_url":"https://api.github.com/users/ctrlplusb/followers","following_url":"https://api.github.com/users/ctrlplusb/following{/other_user}","gists_url":"https://api.github.com/users/ctrlplusb/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlplusb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlplusb/subscriptions","organizations_url":"https://api.github.com/users/ctrlplusb/orgs","repos_url":"https://api.github.com/users/ctrlplusb/repos","events_url":"https://api.github.com/users/ctrlplusb/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlplusb/received_events","type":"User","site_admin":false},"repo":{"id":63956456,"name":"preact-compat","full_name":"ctrlplusb/preact-compat","owner":{"login":"ctrlplusb","id":12164768,"avatar_url":"https://avatars.githubusercontent.com/u/12164768?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlplusb","html_url":"https://github.com/ctrlplusb","followers_url":"https://api.github.com/users/ctrlplusb/followers","following_url":"https://api.github.com/users/ctrlplusb/following{/other_user}","gists_url":"https://api.github.com/users/ctrlplusb/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlplusb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlplusb/subscriptions","organizations_url":"https://api.github.com/users/ctrlplusb/orgs","repos_url":"https://api.github.com/users/ctrlplusb/repos","events_url":"https://api.github.com/users/ctrlplusb/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlplusb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ctrlplusb/preact-compat","description":":raised_hands: React compatibility layer for Preact.","fork":true,"url":"https://api.github.com/repos/ctrlplusb/preact-compat","forks_url":"https://api.github.com/repos/ctrlplusb/preact-compat/forks","keys_url":"https://api.github.com/repos/ctrlplusb/preact-compat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ctrlplusb/preact-compat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ctrlplusb/preact-compat/teams","hooks_url":"https://api.github.com/repos/ctrlplusb/preact-compat/hooks","issue_events_url":"https://api.github.com/repos/ctrlplusb/preact-compat/issues/events{/number}","events_url":"https://api.github.com/repos/ctrlplusb/preact-compat/events","assignees_url":"https://api.github.com/repos/ctrlplusb/preact-compat/assignees{/user}","branches_url":"https://api.github.com/repos/ctrlplusb/preact-compat/branches{/branch}","tags_url":"https://api.github.com/repos/ctrlplusb/preact-compat/tags","blobs_url":"https://api.github.com/repos/ctrlplusb/preact-compat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ctrlplusb/preact-compat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ctrlplusb/preact-compat/git/refs{/sha}","trees_url":"https://api.github.com/repos/ctrlplusb/preact-compat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ctrlplusb/preact-compat/statuses/{sha}","languages_url":"https://api.github.com/repos/ctrlplusb/preact-compat/languages","stargazers_url":"https://api.github.com/repos/ctrlplusb/preact-compat/stargazers","contributors_url":"https://api.github.com/repos/ctrlplusb/preact-compat/contributors","subscribers_url":"https://api.github.com/repos/ctrlplusb/preact-compat/subscribers","subscription_url":"https://api.github.com/repos/ctrlplusb/preact-compat/subscription","commits_url":"https://api.github.com/repos/ctrlplusb/preact-compat/commits{/sha}","git_commits_url":"https://api.github.com/repos/ctrlplusb/preact-compat/git/commits{/sha}","comments_url":"https://api.github.com/repos/ctrlplusb/preact-compat/comments{/number}","issue_comment_url":"https://api.github.com/repos/ctrlplusb/preact-compat/issues/comments{/number}","contents_url":"https://api.github.com/repos/ctrlplusb/preact-compat/contents/{+path}","compare_url":"https://api.github.com/repos/ctrlplusb/preact-compat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ctrlplusb/preact-compat/merges","archive_url":"https://api.github.com/repos/ctrlplusb/preact-compat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ctrlplusb/preact-compat/downloads","issues_url":"https://api.github.com/repos/ctrlplusb/preact-compat/issues{/number}","pulls_url":"https://api.github.com/repos/ctrlplusb/preact-compat/pulls{/number}","milestones_url":"https://api.github.com/repos/ctrlplusb/preact-compat/milestones{/number}","notifications_url":"https://api.github.com/repos/ctrlplusb/preact-compat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ctrlplusb/preact-compat/labels{/name}","releases_url":"https://api.github.com/repos/ctrlplusb/preact-compat/releases{/id}","deployments_url":"https://api.github.com/repos/ctrlplusb/preact-compat/deployments","created_at":"2016-07-22T13:43:07Z","updated_at":"2016-07-22T13:43:08Z","pushed_at":"2016-07-22T13:50:47Z","git_url":"git://github.com/ctrlplusb/preact-compat.git","ssh_url":"git@github.com:ctrlplusb/preact-compat.git","clone_url":"https://github.com/ctrlplusb/preact-compat.git","svn_url":"https://github.com/ctrlplusb/preact-compat","homepage":"http://npm.im/preact-compat","size":114,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"developit:master","ref":"master","sha":"0acb01ec49c429f79049d4f0f45b93648958e981","user":{"login":"developit","id":105127,"avatar_url":"https://avatars.githubusercontent.com/u/105127?v=3","gravatar_id":"","url":"https://api.github.com/users/developit","html_url":"https://github.com/developit","followers_url":"https://api.github.com/users/developit/followers","following_url":"https://api.github.com/users/developit/following{/other_user}","gists_url":"https://api.github.com/users/developit/gists{/gist_id}","starred_url":"https://api.github.com/users/developit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developit/subscriptions","organizations_url":"https://api.github.com/users/developit/orgs","repos_url":"https://api.github.com/users/developit/repos","events_url":"https://api.github.com/users/developit/events{/privacy}","received_events_url":"https://api.github.com/users/developit/received_events","type":"User","site_admin":false},"repo":{"id":45793760,"name":"preact-compat","full_name":"developit/preact-compat","owner":{"login":"developit","id":105127,"avatar_url":"https://avatars.githubusercontent.com/u/105127?v=3","gravatar_id":"","url":"https://api.github.com/users/developit","html_url":"https://github.com/developit","followers_url":"https://api.github.com/users/developit/followers","following_url":"https://api.github.com/users/developit/following{/other_user}","gists_url":"https://api.github.com/users/developit/gists{/gist_id}","starred_url":"https://api.github.com/users/developit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developit/subscriptions","organizations_url":"https://api.github.com/users/developit/orgs","repos_url":"https://api.github.com/users/developit/repos","events_url":"https://api.github.com/users/developit/events{/privacy}","received_events_url":"https://api.github.com/users/developit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/developit/preact-compat","description":":raised_hands: React compatibility layer for Preact.","fork":false,"url":"https://api.github.com/repos/developit/preact-compat","forks_url":"https://api.github.com/repos/developit/preact-compat/forks","keys_url":"https://api.github.com/repos/developit/preact-compat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/developit/preact-compat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/developit/preact-compat/teams","hooks_url":"https://api.github.com/repos/developit/preact-compat/hooks","issue_events_url":"https://api.github.com/repos/developit/preact-compat/issues/events{/number}","events_url":"https://api.github.com/repos/developit/preact-compat/events","assignees_url":"https://api.github.com/repos/developit/preact-compat/assignees{/user}","branches_url":"https://api.github.com/repos/developit/preact-compat/branches{/branch}","tags_url":"https://api.github.com/repos/developit/preact-compat/tags","blobs_url":"https://api.github.com/repos/developit/preact-compat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/developit/preact-compat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/developit/preact-compat/git/refs{/sha}","trees_url":"https://api.github.com/repos/developit/preact-compat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/developit/preact-compat/statuses/{sha}","languages_url":"https://api.github.com/repos/developit/preact-compat/languages","stargazers_url":"https://api.github.com/repos/developit/preact-compat/stargazers","contributors_url":"https://api.github.com/repos/developit/preact-compat/contributors","subscribers_url":"https://api.github.com/repos/developit/preact-compat/subscribers","subscription_url":"https://api.github.com/repos/developit/preact-compat/subscription","commits_url":"https://api.github.com/repos/developit/preact-compat/commits{/sha}","git_commits_url":"https://api.github.com/repos/developit/preact-compat/git/commits{/sha}","comments_url":"https://api.github.com/repos/developit/preact-compat/comments{/number}","issue_comment_url":"https://api.github.com/repos/developit/preact-compat/issues/comments{/number}","contents_url":"https://api.github.com/repos/developit/preact-compat/contents/{+path}","compare_url":"https://api.github.com/repos/developit/preact-compat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/developit/preact-compat/merges","archive_url":"https://api.github.com/repos/developit/preact-compat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/developit/preact-compat/downloads","issues_url":"https://api.github.com/repos/developit/preact-compat/issues{/number}","pulls_url":"https://api.github.com/repos/developit/preact-compat/pulls{/number}","milestones_url":"https://api.github.com/repos/developit/preact-compat/milestones{/number}","notifications_url":"https://api.github.com/repos/developit/preact-compat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/developit/preact-compat/labels{/name}","releases_url":"https://api.github.com/repos/developit/preact-compat/releases{/id}","deployments_url":"https://api.github.com/repos/developit/preact-compat/deployments","created_at":"2015-11-08T18:47:28Z","updated_at":"2016-07-20T20:03:55Z","pushed_at":"2016-07-22T13:50:47Z","git_url":"git://github.com/developit/preact-compat.git","ssh_url":"git@github.com:developit/preact-compat.git","clone_url":"https://github.com/developit/preact-compat.git","svn_url":"https://github.com/developit/preact-compat","homepage":"http://npm.im/preact-compat","size":114,"stargazers_count":73,"watchers_count":73,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":7,"forks":12,"open_issues":7,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/developit/preact-compat/pulls/128"},"html":{"href":"https://github.com/developit/preact-compat/pull/128"},"issue":{"href":"https://api.github.com/repos/developit/preact-compat/issues/128"},"comments":{"href":"https://api.github.com/repos/developit/preact-compat/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/developit/preact-compat/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/developit/preact-compat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/developit/preact-compat/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/developit/preact-compat/statuses/ba38e00145306b29688434532bf251668dfc3c9e"}}}}
{"actor":{"display_login":"developit"}}