-
Notifications
You must be signed in to change notification settings - Fork 50.3k
Closed as not planned
Closed as not planned
Copy link
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
Re-rendering nested components breaks event-handlers; wrapping handler functions in useCallback makes no difference
React version: 18.2
Link to code example: https://codesandbox.io/s/re-rendering-breaks-event-listener-2dxjhz
Note: The repro makes use of Touch events, so open the Sandbox link on a mobile device
The current behavior
onTouchEnd does not fire when re-rendering a nested component, even when caching handler-functions with useCallback
The expected behavior
Re-rendering a nested component should have no effect on its parent's event-listeners
Metadata
Metadata
Assignees
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug