Skip to content

fix(toggle): issues in toggle button#104

Open
Amarjit-Singh-1 wants to merge 1 commit intogofynd:mainfrom
Amarjit-Singh-1:fix/toggle-button
Open

fix(toggle): issues in toggle button#104
Amarjit-Singh-1 wants to merge 1 commit intogofynd:mainfrom
Amarjit-Singh-1:fix/toggle-button

Conversation

@Amarjit-Singh-1
Copy link

@Amarjit-Singh-1 Amarjit-Singh-1 commented Nov 27, 2023

I have faced some issues in the ToggleButton of the Nitrozen React in some of our extensions
Below are the issues and the PR for the same

  • ToggleButton Component has its own state but it has not been passed to the onToggle, which requires us to create and maintain a separate state.
  • The onChange function is wrapped inside a useCallback which only has the dependency of toggleActive. This leads to the function forming a closure with the previous state value and leads to unwanted behaviour in some cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments