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
Setting a width value with state isn't ideal, if you have a more complex difference in the UI, it can be quite difficult to store all that information in state.
At a basic level, this state value tracks whether the sidebar is open, or not.
So calling it isOpen or something similar, and having a true/false value is recommended.
It seems like more effort in this example since only width is changing, but if we have a more complex UI change it's not ideal to store the css values directly in state. Instead store a boolean describing the state, and set classNames or styles depending on that boolean.
The text was updated successfully, but these errors were encountered:
tfb-bonf/src/components/Sidebar/Sidebar.jsx
Lines 13 to 15 in 85b7aa3
Setting a width value with state isn't ideal, if you have a more complex difference in the UI, it can be quite difficult to store all that information in state.
At a basic level, this state value tracks whether the sidebar is open, or not.
So calling it isOpen or something similar, and having a true/false value is recommended.
Now you can conditionally change classNames or inline styles depending on this state value.
It seems like more effort in this example since only width is changing, but if we have a more complex UI change it's not ideal to store the css values directly in state. Instead store a boolean describing the state, and set classNames or styles depending on that boolean.
The text was updated successfully, but these errors were encountered: