Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: useCallbackRef now actually works #8133

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

benwiley4000
Copy link

Closes #

📝 Description

fixes useCallbackRef

⛳️ Current behavior (updates)

useCallbackRef doesn't work

🚀 New behavior

it works now

💣 Is this a breaking change (Yes/No):

hopefully not

📝 Additional Information

Copy link

changeset-bot bot commented Nov 23, 2023

🦋 Changeset detected

Latest commit: 7706256

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@chakra-ui/react-use-callback-ref Patch
@chakra-ui/checkbox Patch
@chakra-ui/counter Patch
@chakra-ui/editable Patch
@chakra-ui/number-input Patch
@chakra-ui/slider Patch
@chakra-ui/react-use-controllable-state Patch
@chakra-ui/react-use-disclosure Patch
@chakra-ui/react-use-event-listener Patch
@chakra-ui/react-use-interval Patch
@chakra-ui/react-use-outside-click Patch
@chakra-ui/react-use-timeout Patch
@chakra-ui/react Patch
@chakra-ui/switch Patch
@chakra-ui/accordion Patch
@chakra-ui/menu Patch
@chakra-ui/pin-input Patch
@chakra-ui/tabs Patch
@chakra-ui/popover Patch
@chakra-ui/tooltip Patch
@chakra-ui/react-use-animation-state Patch
@chakra-ui/react-use-focus-effect Patch
@chakra-ui/react-use-focus-on-pointer-down Patch
@chakra-ui/toast Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
chakra-ui-storybook ✅ Ready (Inspect) Visit Preview Nov 23, 2023 9:22pm

@benwiley4000
Copy link
Author

One alternative option (to honor the dependencies) would be to keep the use effect but pass the dependency array there instead of into the useCallback. But I see little practical reason to only update the callback when the dependencies change.

@segunadebayo
Copy link
Member

When you say it doesn't work, what do you mean @benwiley4000? could you provide a reproduction?

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.

None yet

2 participants