Files
react-native/scripts
Janic Duplessis a9473b5ed5 Name the no-tag sentinel and use it for the hardcoded -1 tags (#58531)
Summary:
React tags are positive; `-1` marks the absence of one in several places with a bare literal. This names the convention — `kNoTag` in `ReactPrimitives.h`, next to the `Tag` alias and mirroring `ViewUtil.NO_SURFACE_ID` on the Android side — and replaces the literals across the renderer: `ShadowViewMutation`'s `parentTag` default, factories and comparison, the stub view tree (folding its duplicate `NO_VIEW_TAG` constant into `kNoTag`), the `CppMountItem` mirrors on Android, `UIManagerViewTransitionDelegate`'s `nativeTag` and the view transition fallback that feeds it, and the pointer-events no-override comparisons.

Split out of the safe area insets stack: https://github.com/react/react-native/issues/58530 threads a `Tag` with no-tag semantics through `experimental_flushSync` and wants the named sentinel, but the cleanup stands on its own and can land regardless of that PR's fate.

## Changelog:

[INTERNAL] - Name the no-tag sentinel (`kNoTag`) and use it for the hardcoded `-1` tags

Pull Request resolved: https://github.com/react/react-native/pull/58531

Test Plan: Compiles via the Fantom tester build; `yarn fantom` mounting-heavy suite passes 224/224 (exercises the `StubViewTree` asserts). C++ API snapshots regenerated — the only delta is the new `kNoTag` constant.

Reviewed By: javache

Differential Revision: D120199347

Pulled By: Abbondanzo

fbshipit-source-id: 4198a33fa601edff53c54bce935814b3414c5820
2026-09-16 02:38:27 -07:00
..