{"action":"created","issue":{"url":"https://api.github.com/repos/styleguidist/react-styleguidist/issues/1108","repository_url":"https://api.github.com/repos/styleguidist/react-styleguidist","labels_url":"https://api.github.com/repos/styleguidist/react-styleguidist/issues/1108/labels{/name}","comments_url":"https://api.github.com/repos/styleguidist/react-styleguidist/issues/1108/comments","events_url":"https://api.github.com/repos/styleguidist/react-styleguidist/issues/1108/events","html_url":"https://github.com/styleguidist/react-styleguidist/issues/1108","id":354171773,"node_id":"MDU6SXNzdWUzNTQxNzE3NzM=","number":1108,"title":"[Design Question]Why styleguidist rendered ReactExample Component outside of the root Component?","user":{"login":"MrKou47","id":13513747,"node_id":"MDQ6VXNlcjEzNTEzNzQ3","avatar_url":"https://avatars2.githubusercontent.com/u/13513747?v=4","gravatar_id":"","url":"https://api.github.com/users/MrKou47","html_url":"https://github.com/MrKou47","followers_url":"https://api.github.com/users/MrKou47/followers","following_url":"https://api.github.com/users/MrKou47/following{/other_user}","gists_url":"https://api.github.com/users/MrKou47/gists{/gist_id}","starred_url":"https://api.github.com/users/MrKou47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrKou47/subscriptions","organizations_url":"https://api.github.com/users/MrKou47/orgs","repos_url":"https://api.github.com/users/MrKou47/repos","events_url":"https://api.github.com/users/MrKou47/events{/privacy}","received_events_url":"https://api.github.com/users/MrKou47/received_events","type":"User","site_admin":false},"labels":[{"id":257203244,"node_id":"MDU6TGFiZWwyNTcyMDMyNDQ=","url":"https://api.github.com/repos/styleguidist/react-styleguidist/labels/question","name":"question","color":"d876e3","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-27T03:59:16Z","updated_at":"2018-09-20T15:28:45Z","closed_at":"2018-09-05T09:34:56Z","author_association":"CONTRIBUTOR","body":"I'm trying to control my examples use a global redux store(e.g. my components has two different theme, i want to use a global button to change those theme props).But i find that the ReactExample components rendered outside the StyleGuide component [Preview.js#L78](https://github.com/styleguidist/react-styleguidist/blob/master/src/rsg-components/Preview/Preview.js#L78),so they can't be controlled by me.I want to know why this part is designed like this, and could i change this part?"},"comment":{"url":"https://api.github.com/repos/styleguidist/react-styleguidist/issues/comments/423227114","html_url":"https://github.com/styleguidist/react-styleguidist/issues/1108#issuecomment-423227114","issue_url":"https://api.github.com/repos/styleguidist/react-styleguidist/issues/1108","id":423227114,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzIyNzExNA==","user":{"login":"MrKou47","id":13513747,"node_id":"MDQ6VXNlcjEzNTEzNzQ3","avatar_url":"https://avatars2.githubusercontent.com/u/13513747?v=4","gravatar_id":"","url":"https://api.github.com/users/MrKou47","html_url":"https://github.com/MrKou47","followers_url":"https://api.github.com/users/MrKou47/followers","following_url":"https://api.github.com/users/MrKou47/following{/other_user}","gists_url":"https://api.github.com/users/MrKou47/gists{/gist_id}","starred_url":"https://api.github.com/users/MrKou47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrKou47/subscriptions","organizations_url":"https://api.github.com/users/MrKou47/orgs","repos_url":"https://api.github.com/users/MrKou47/repos","events_url":"https://api.github.com/users/MrKou47/events{/privacy}","received_events_url":"https://api.github.com/users/MrKou47/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T15:28:45Z","updated_at":"2018-09-20T15:28:45Z","author_association":"CONTRIBUTOR","body":"@bbr-yp aha, I used the `React.createContext` api to achieve switch components theme use global theme switch button.All of my components will be wrapped in a hoc component,and this component can get the theme prop form the `window.location.query` and update theme context. Then i customize <SideBar /> component for switch global theme,just redirect website, like `http://mycomponent.com?theme=light` or `http://mycomponent.com?theme=dark`. You can try it😁\r\n"}}
{"actor":{"display_login":"MrKou47"}}