You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,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?
The text was updated successfully, but these errors were encountered:
I had achieved my idea by using react@16 context, every my component wrapped by ThemeComponent and it can get theme prop from the query from window.location.href.
But i'm afraid i'm not clearly know which work does plugin API do and i can't find any doc about plugin API.I guess it will give us some ability for decorate styleguide component🤔?But when i want to change some styleguide component, i will create my own styleguide component and put it in the styleguide.config.js.
@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 component for switch global theme,just redirect website, like http://mycomponent.com?theme=light or http://mycomponent.com?theme=dark. You can try it😁
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,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?
The text was updated successfully, but these errors were encountered: