Skip to content

Conversation

@yyassi-heartex
Copy link
Contributor

This pull request updates the Toggle component in web/libs/ui/src/lib/toggle/toggle.tsx to improve performance and maintainability by introducing the useCallback hook for the onChange handler. The most important changes are summarized below:

Ultimatly this allows us to undo a toggle from the parent if needed

Performance Improvement:

  • Introduced useCallback for onChange handler: Added a memoized onChangeHandler function using useCallback to optimize re-renders and ensure consistent function references.

Code Simplification:

  • Replaced inline onChange logic with onChangeHandler: Updated the onChange prop of the input element to use the new onChangeHandler function, replacing the previous inline logic.

Dependency Updates:

  • Updated imports to include useCallback: Added useCallback to the list of imported hooks from React.

@netlify
Copy link

netlify bot commented Jun 11, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 9f8b288
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/68498c0a4c5a170008b2d191

@github-actions github-actions bot added the fix label Jun 11, 2025
@netlify
Copy link

netlify bot commented Jun 11, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 9f8b288
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/68498c0a33ad2b0008ba55b0
😎 Deploy Preview https://deploy-preview-7734--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jun 11, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 9f8b288
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/68498c0a13c5e10008065e3b
😎 Deploy Preview https://deploy-preview-7734--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jun 11, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 9f8b288
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/68498c0a33ad2b0008ba55ac

@yyassi-heartex yyassi-heartex requested a review from a team June 11, 2025 03:52
@yyassi-heartex
Copy link
Contributor Author

yyassi-heartex commented Jun 11, 2025

/git merge

Workflow run
Successfully merged: 1 file changed, 5 insertions(+), 1 deletion(-)

@yyassi-heartex
Copy link
Contributor Author

yyassi-heartex commented Jun 11, 2025

/git merge

Workflow run
Successfully merged: 1 file changed, 14 insertions(+), 2 deletions(-)

@robot-ci-heartex robot-ci-heartex merged commit 63d0c85 into develop Jun 11, 2025
44 checks passed
@robot-ci-heartex robot-ci-heartex deleted the fb-fit-221/toggle branch June 11, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants