Repository navigation
Commit 3f553d7
Fix IllegalStateException in SurfaceMountingManager.removeViewAt (#57860)
Summary:
Pull Request resolved: #57860
Fix a crash in `SurfaceMountingManager.removeViewAt()` where an `IllegalStateException` is thrown when the parent view is not a `ViewGroup`.
The Fabric differ can emit inconsistent remove instructions that reference a parent whose instantiated view is no longer a `ViewGroup` (e.g. after view recycling). Since a non-`ViewGroup` cannot hold child views, the removal is a semantic no-op.
Replace the hard throw with `ReactSoftExceptionLogger.logSoftException` + early return, matching the defensive pattern already used by peer conditions in the same method (null `parentViewState`, child already removed, wrong index). Also fixes a "a a" typo in the error message.
Changelog:
[Android] [Fixed] - Fix IllegalStateException in SurfaceMountingManager.removeViewAt
Reviewed By: zeyap
Differential Revision: D115211130
fbshipit-source-id: 942a5fea8f31927ded86774c2e01cd01225179c51 parent 0f1bddd commit 3f553d7
1 file changed
Lines changed: 7 additions & 4 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
434 | 437 | | |
435 | 438 | | |
436 | 439 | | |
| |||
0 commit comments