{"action":"created","comment":{"url":"https://api.github.com/repos/airbnb/react-with-styles/pulls/comments/166719222","pull_request_review_id":94828085,"id":166719222,"diff_hunk":"@@ -68,12 +71,46 @@ export function withStyles(\n     // NOTE: Use a class here so components are ref-able if need be:\n     // eslint-disable-next-line react/prefer-stateless-function\n     class WithStyles extends BaseClass {\n+      constructor(props, context) {\n+        super(props, context);\n+\n+        // direction needs to be stored in state in order to trigger a rerender\n+        // when context changes.\n+        this.state = {\n+          direction: context[CHANNEL] ? context[CHANNEL].getState() : defaultDirection,\n+        };\n+      }\n+\n       componentWillMount() {\n         this.maybeCreateStyles();\n       }\n \n+      componentDidMount() {\n+        if (this.context[CHANNEL]) {\n+          // subscribe to future direction changes\n+          this.channelUnsubscribe = this.context[CHANNEL].subscribe((direction) => {","path":"src/withStyles.jsx","position":61,"original_position":61,"commit_id":"1ecee9df871cca41360d52e4759159c48bea49f9","original_commit_id":"1ecee9df871cca41360d52e4759159c48bea49f9","user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars1.githubusercontent.com/u/45469?v=4","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"body":"That’d be a great follow up, i had the same thought","created_at":"2018-02-07T18:56:55Z","updated_at":"2018-02-07T18:56:55Z","html_url":"https://github.com/airbnb/react-with-styles/pull/124#discussion_r166719222","pull_request_url":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/airbnb/react-with-styles/pulls/comments/166719222"},"html":{"href":"https://github.com/airbnb/react-with-styles/pull/124#discussion_r166719222"},"pull_request":{"href":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124"}},"in_reply_to_id":166410967},"pull_request":{"url":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124","id":161687149,"html_url":"https://github.com/airbnb/react-with-styles/pull/124","diff_url":"https://github.com/airbnb/react-with-styles/pull/124.diff","patch_url":"https://github.com/airbnb/react-with-styles/pull/124.patch","issue_url":"https://api.github.com/repos/airbnb/react-with-styles/issues/124","number":124,"state":"closed","locked":false,"title":"Send css method down as a prop instead of as a global","user":{"login":"majapw","id":1383861,"avatar_url":"https://avatars1.githubusercontent.com/u/1383861?v=4","gravatar_id":"","url":"https://api.github.com/users/majapw","html_url":"https://github.com/majapw","followers_url":"https://api.github.com/users/majapw/followers","following_url":"https://api.github.com/users/majapw/following{/other_user}","gists_url":"https://api.github.com/users/majapw/gists{/gist_id}","starred_url":"https://api.github.com/users/majapw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majapw/subscriptions","organizations_url":"https://api.github.com/users/majapw/orgs","repos_url":"https://api.github.com/users/majapw/repos","events_url":"https://api.github.com/users/majapw/events{/privacy}","received_events_url":"https://api.github.com/users/majapw/received_events","type":"User","site_admin":false},"body":"In order to solve some problems we've seen with specificity, as well as some server-side/client-side disparities, we will be attempting to separate out RTL and LTR styles entirely. Part of this has been accomplished by splitting StyleSheet creation into RTL and LTR. The next step is to send down a directional CSS method as a prop. \r\n\r\nI've left in the resolve method as is... but I'm unsure if that is necessary. Should we still export it from the ThemedStyleSheet or the withStyles file? \r\n\r\n\r\nto: @yzimet @lencioni @garrettberg @ljharb @airbnb/webinfra ","created_at":"2018-01-08T17:50:19Z","updated_at":"2018-02-07T18:56:55Z","closed_at":"2018-02-06T20:55:31Z","merged_at":"2018-02-06T20:55:31Z","merge_commit_sha":"406a2cc95dee8939d33da6564c2152fa9154900e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124/commits","review_comments_url":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124/comments","review_comment_url":"https://api.github.com/repos/airbnb/react-with-styles/pulls/comments{/number}","comments_url":"https://api.github.com/repos/airbnb/react-with-styles/issues/124/comments","statuses_url":"https://api.github.com/repos/airbnb/react-with-styles/statuses/1ecee9df871cca41360d52e4759159c48bea49f9","head":{"label":"airbnb:maja-add-css-method-as-a-prop-based-on-direction","ref":"maja-add-css-method-as-a-prop-based-on-direction","sha":"1ecee9df871cca41360d52e4759159c48bea49f9","user":{"login":"airbnb","id":698437,"avatar_url":"https://avatars3.githubusercontent.com/u/698437?v=4","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"repo":{"id":66389842,"name":"react-with-styles","full_name":"airbnb/react-with-styles","owner":{"login":"airbnb","id":698437,"avatar_url":"https://avatars3.githubusercontent.com/u/698437?v=4","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/airbnb/react-with-styles","description":"Use CSS-in-JavaScript with themes for React without being tightly coupled to one implementation","fork":false,"url":"https://api.github.com/repos/airbnb/react-with-styles","forks_url":"https://api.github.com/repos/airbnb/react-with-styles/forks","keys_url":"https://api.github.com/repos/airbnb/react-with-styles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airbnb/react-with-styles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airbnb/react-with-styles/teams","hooks_url":"https://api.github.com/repos/airbnb/react-with-styles/hooks","issue_events_url":"https://api.github.com/repos/airbnb/react-with-styles/issues/events{/number}","events_url":"https://api.github.com/repos/airbnb/react-with-styles/events","assignees_url":"https://api.github.com/repos/airbnb/react-with-styles/assignees{/user}","branches_url":"https://api.github.com/repos/airbnb/react-with-styles/branches{/branch}","tags_url":"https://api.github.com/repos/airbnb/react-with-styles/tags","blobs_url":"https://api.github.com/repos/airbnb/react-with-styles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airbnb/react-with-styles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airbnb/react-with-styles/git/refs{/sha}","trees_url":"https://api.github.com/repos/airbnb/react-with-styles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airbnb/react-with-styles/statuses/{sha}","languages_url":"https://api.github.com/repos/airbnb/react-with-styles/languages","stargazers_url":"https://api.github.com/repos/airbnb/react-with-styles/stargazers","contributors_url":"https://api.github.com/repos/airbnb/react-with-styles/contributors","subscribers_url":"https://api.github.com/repos/airbnb/react-with-styles/subscribers","subscription_url":"https://api.github.com/repos/airbnb/react-with-styles/subscription","commits_url":"https://api.github.com/repos/airbnb/react-with-styles/commits{/sha}","git_commits_url":"https://api.github.com/repos/airbnb/react-with-styles/git/commits{/sha}","comments_url":"https://api.github.com/repos/airbnb/react-with-styles/comments{/number}","issue_comment_url":"https://api.github.com/repos/airbnb/react-with-styles/issues/comments{/number}","contents_url":"https://api.github.com/repos/airbnb/react-with-styles/contents/{+path}","compare_url":"https://api.github.com/repos/airbnb/react-with-styles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airbnb/react-with-styles/merges","archive_url":"https://api.github.com/repos/airbnb/react-with-styles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airbnb/react-with-styles/downloads","issues_url":"https://api.github.com/repos/airbnb/react-with-styles/issues{/number}","pulls_url":"https://api.github.com/repos/airbnb/react-with-styles/pulls{/number}","milestones_url":"https://api.github.com/repos/airbnb/react-with-styles/milestones{/number}","notifications_url":"https://api.github.com/repos/airbnb/react-with-styles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airbnb/react-with-styles/labels{/name}","releases_url":"https://api.github.com/repos/airbnb/react-with-styles/releases{/id}","deployments_url":"https://api.github.com/repos/airbnb/react-with-styles/deployments","created_at":"2016-08-23T17:49:48Z","updated_at":"2018-02-07T00:14:56Z","pushed_at":"2018-02-06T21:08:39Z","git_url":"git://github.com/airbnb/react-with-styles.git","ssh_url":"git@github.com:airbnb/react-with-styles.git","clone_url":"https://github.com/airbnb/react-with-styles.git","svn_url":"https://github.com/airbnb/react-with-styles","homepage":"","size":116,"stargazers_count":1017,"watchers_count":1017,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":61,"open_issues":20,"watchers":1017,"default_branch":"master"}},"base":{"label":"airbnb:master","ref":"master","sha":"4835e157e395dc400d66da732550bb0bfe23e869","user":{"login":"airbnb","id":698437,"avatar_url":"https://avatars3.githubusercontent.com/u/698437?v=4","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"repo":{"id":66389842,"name":"react-with-styles","full_name":"airbnb/react-with-styles","owner":{"login":"airbnb","id":698437,"avatar_url":"https://avatars3.githubusercontent.com/u/698437?v=4","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/airbnb/react-with-styles","description":"Use CSS-in-JavaScript with themes for React without being tightly coupled to one implementation","fork":false,"url":"https://api.github.com/repos/airbnb/react-with-styles","forks_url":"https://api.github.com/repos/airbnb/react-with-styles/forks","keys_url":"https://api.github.com/repos/airbnb/react-with-styles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airbnb/react-with-styles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airbnb/react-with-styles/teams","hooks_url":"https://api.github.com/repos/airbnb/react-with-styles/hooks","issue_events_url":"https://api.github.com/repos/airbnb/react-with-styles/issues/events{/number}","events_url":"https://api.github.com/repos/airbnb/react-with-styles/events","assignees_url":"https://api.github.com/repos/airbnb/react-with-styles/assignees{/user}","branches_url":"https://api.github.com/repos/airbnb/react-with-styles/branches{/branch}","tags_url":"https://api.github.com/repos/airbnb/react-with-styles/tags","blobs_url":"https://api.github.com/repos/airbnb/react-with-styles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airbnb/react-with-styles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airbnb/react-with-styles/git/refs{/sha}","trees_url":"https://api.github.com/repos/airbnb/react-with-styles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airbnb/react-with-styles/statuses/{sha}","languages_url":"https://api.github.com/repos/airbnb/react-with-styles/languages","stargazers_url":"https://api.github.com/repos/airbnb/react-with-styles/stargazers","contributors_url":"https://api.github.com/repos/airbnb/react-with-styles/contributors","subscribers_url":"https://api.github.com/repos/airbnb/react-with-styles/subscribers","subscription_url":"https://api.github.com/repos/airbnb/react-with-styles/subscription","commits_url":"https://api.github.com/repos/airbnb/react-with-styles/commits{/sha}","git_commits_url":"https://api.github.com/repos/airbnb/react-with-styles/git/commits{/sha}","comments_url":"https://api.github.com/repos/airbnb/react-with-styles/comments{/number}","issue_comment_url":"https://api.github.com/repos/airbnb/react-with-styles/issues/comments{/number}","contents_url":"https://api.github.com/repos/airbnb/react-with-styles/contents/{+path}","compare_url":"https://api.github.com/repos/airbnb/react-with-styles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airbnb/react-with-styles/merges","archive_url":"https://api.github.com/repos/airbnb/react-with-styles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airbnb/react-with-styles/downloads","issues_url":"https://api.github.com/repos/airbnb/react-with-styles/issues{/number}","pulls_url":"https://api.github.com/repos/airbnb/react-with-styles/pulls{/number}","milestones_url":"https://api.github.com/repos/airbnb/react-with-styles/milestones{/number}","notifications_url":"https://api.github.com/repos/airbnb/react-with-styles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airbnb/react-with-styles/labels{/name}","releases_url":"https://api.github.com/repos/airbnb/react-with-styles/releases{/id}","deployments_url":"https://api.github.com/repos/airbnb/react-with-styles/deployments","created_at":"2016-08-23T17:49:48Z","updated_at":"2018-02-07T00:14:56Z","pushed_at":"2018-02-06T21:08:39Z","git_url":"git://github.com/airbnb/react-with-styles.git","ssh_url":"git@github.com:airbnb/react-with-styles.git","clone_url":"https://github.com/airbnb/react-with-styles.git","svn_url":"https://github.com/airbnb/react-with-styles","homepage":"","size":116,"stargazers_count":1017,"watchers_count":1017,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":61,"open_issues":20,"watchers":1017,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124"},"html":{"href":"https://github.com/airbnb/react-with-styles/pull/124"},"issue":{"href":"https://api.github.com/repos/airbnb/react-with-styles/issues/124"},"comments":{"href":"https://api.github.com/repos/airbnb/react-with-styles/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/airbnb/react-with-styles/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/airbnb/react-with-styles/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/airbnb/react-with-styles/statuses/1ecee9df871cca41360d52e4759159c48bea49f9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ljharb"}}