Commit 0f3115f
[General] Register mount reactions in layout effect to avoid crash on unmounted detector
Run the GestureDetector mount listener in a layout effect (matching the
attach/drop phase) and bail out when the detector is no longer mounted,
preventing updates to a detached detector.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 7453280 commit 0f3115f
1 file changed
Lines changed: 10 additions & 2 deletions
File tree
- packages/react-native-gesture-handler/src/handlers/gestures/GestureDetector
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments