nitro-ui-renderer-ownership

Installation
SKILL.md
  • Distinguish the hybrid view, hybrid gesture recognizer, and underlying UIKit objects. Mounted React host instances are retained by React, and mountedViews retains the root container's direct children; a gesture owner being destroyed does not imply its mounted hybrid view was collected.
  • Retain each attached hybrid gesture object in ordinary typed state on its hybrid view. Retaining only its UIGestureRecognizer loses the object that owns the callback: UIKit does not retain the recognizer's target.
  • Express ownership through stored properties. Do not use Objective-C associated objects, global side tables, or JavaScript demo references to compensate for missing native ownership.
  • Keep shared behavior in View and explicit storage in every conforming implementation, including navigation views. A reverse reference from a gesture to its owning hybrid view must be weak.
  • Release previous ownership on replacement, removal, and gesture transfer. Remove only recognizers owned by the hybrid view; preserve UIKit's built-in scroll and text-input recognizers.
  • React deletion must clear gestures for every host instance in a removed subtree, including descendants whose native views are removed with their parent. Moving a React view does not delete it or tear down its gestures.
  • Detaching preserves callbacks for reuse. Permanent disposal clears the callback, removes the native target/action, detaches the recognizer, and releases its owning view's stored reference.
  • A gesture callback can capture its view and form a cycle. Explicit deletion cleanup must break that cycle. A callback scope retaining the gesture itself is a separate cycle; investigate its retain chain before changing callback reuse or teardown semantics.
  • Validate both directions of the lifecycle: callbacks survive dropping JavaScript gesture references and forced GC while mounted; replacement, removal, transfer, and nested unmount release the hybrid owners. Use weak references to check release, including callbacks that capture their view. Keep validation fixtures outside the repository as required by AGENTS.md.
Installs
3
GitHub Stars
1.4K
First Seen
3 days ago