Skip to content

Commit f44fe9c

Browse files
authored
chore(iOS): add code comment explaining validity of a tag value (#2840)
## Description Following up: * #2249 (comment) * [internal ticket](https://github.com/orgs/software-mansion/projects/3/views/1?pane=issue&itemId=72358100) ## Changes Added a code comment explaining that there are scenarios where `self.tag` might not have valid value during component removal from screen stack. ## Test code and steps to reproduce N/A ## Checklist - [ ] Ensured that CI passes
1 parent a5b9750 commit f44fe9c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ios/RNSScreenStack.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,9 @@ - (void)mountingTransactionDidMount:(const facebook::react::MountingTransaction
12341234
withSurfaceTelemetry:(const facebook::react::SurfaceTelemetry &)surfaceTelemetry
12351235
{
12361236
for (const auto &mutation : transaction.getMutations()) {
1237+
// Note that self.tag might be invalid in cases this stack is removed.
1238+
// This mostlikely does not cause any problems now, but it is something
1239+
// worth to be aware of.
12371240
if (MUTATION_PARENT_TAG(mutation) == self.tag &&
12381241
(mutation.type == react::ShadowViewMutation::Type::Insert ||
12391242
mutation.type == react::ShadowViewMutation::Type::Remove)) {

0 commit comments

Comments
 (0)