Skip to content

fix(use-forward-expose): fix useForwardExpose crash when node is not existed#3780

Merged
segunadebayo merged 1 commit intochakra-ui:mainfrom
Hwacc:fix/forward-ref
Feb 13, 2026
Merged

fix(use-forward-expose): fix useForwardExpose crash when node is not existed#3780
segunadebayo merged 1 commit intochakra-ui:mainfrom
Hwacc:fix/forward-ref

Conversation

@Hwacc
Copy link
Contributor

@Hwacc Hwacc commented Feb 12, 2026

When I was using useForwardExpose in Vue, I found that if an element is bound with forwardRef and the element does not exist at that time, it throws an error and causes a crash.

Here is a simple example to reproduce this issue : https://stackblitz.com/edit/9tedmmel

Steps to reproduce:

  1. Click the button to hide the block below.
  2. An error message will be printed in the console.

Fixed an incorrect null check order inside the forwardRef function that could cause this crash.

  • Just in Vue

@vercel
Copy link

vercel bot commented Feb 12, 2026

@Hwacc is attempting to deploy a commit to the Chakra UI Team on Vercel.

A member of the Team first needs to authorize it.

@Hwacc Hwacc changed the title fix(use-forward-expose): fix useForwardExpose crush when node is not existed fix(use-forward-expose): fix useForwardExpose crash when node is not existed Feb 12, 2026
@segunadebayo segunadebayo merged commit 17106b4 into chakra-ui:main Feb 13, 2026
5 of 6 checks passed
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