Semantic UI Sidebar.Pushable won't update page content

坚强是说给别人听的谎言 提交于 2019-12-11 15:03:23

问题


I'm using redux to manage my sidebar visibility state(sidebarvis: true, false). Routing is also managed by redux.

When I click a link to change pages within my visible sidebar, redux is successfully updating the router state, but the content within sidebar.pushable does not update until my sidebar is toggled(AKA until the toggleSideBar action is dispatched).

In other words, redux is working properly, but the page doesn't render until the sidebar is toggled again. Has anyone else had this issue?


回答1:


Found the issue. Semantic-Ui suggests placing the sidebar at the root level so that all of your content is wrapped within Sidebar.Pusher.

This is fine if you are using react state, but if you are using redux, the root (or App level container as we commonly see in examples) container doesn't seem to like being hooked up to the redux store.

I simply created a sidebar component, rendered that within the root container, and passed in all my routes as children to the sidebar.



来源:https://stackoverflow.com/questions/51028558/semantic-ui-sidebar-pushable-wont-update-page-content

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!