azouaoui-med / react-pro-sidebar

React Pro Sidebar provides a set of components for creating high level and customizable side navigation
https://azouaoui-med.github.io/react-pro-sidebar/
MIT License
1.72k stars 412 forks source link

Initial collapsed state is always false on the initial render #155

Closed ocimer closed 1 year ago

ocimer commented 1 year ago

Describe the bug Initial state of the collapsed value is always false on the initial render (only), even when "defaultCollapsed" prop is set.

To Reproduce Steps to reproduce the behavior:

  1. Go to sanbox
  2. Refresh the page in the web view area and observe the console and the web view area.
  3. In the web view you will clearly see a jump from not collapsed to collapsed on page refresh, and the console will output "false" on initial render and "true" after.

Expected behavior With the "defaultCollapsed" prop set I expect the sidebar to be collapsed even on the initial render.

Desktop (please complete the following information): Any modern browser

Ishadir commented 1 year ago

https://user-images.githubusercontent.com/73375508/231545263-1dbb8010-4a7f-4b7c-a898-72e77eb36ec0.mp4

same here, im using defaultCollapsed true and this happends when i refresh the page with f5 or i enter the first time.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.