@leonsilicon/react-native-wishlist 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -183,14 +183,22 @@ Value ShadowNodeBinding::get(Runtime &rt, const PropNameID &nameProp) {
|
|
|
183
183
|
auto newChildren =
|
|
184
184
|
std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>();
|
|
185
185
|
|
|
186
|
+
// Items in `subItems` come from `pool.getComponent(type)`, which
|
|
187
|
+
// already returns a fresh deep-copy of the registered template (with
|
|
188
|
+
// unique negative react tags). Re-copying here would generate yet
|
|
189
|
+
// another set of tags, and the nested `ShadowNodeBinding`s (e.g. a
|
|
190
|
+
// `Wishlist.Pressable` inside the child template) still point at the
|
|
191
|
+
// pre-copy shadow nodes — so callbacks and gesture handlers registered
|
|
192
|
+
// against the binding's tag never reach the mounted UIView (RNGH on
|
|
193
|
+
// iOS looks the view up via the new tag and finds nothing). Reuse the
|
|
194
|
+
// bindings' existing shadow nodes directly to keep the tags stable
|
|
195
|
+
// through to mount.
|
|
186
196
|
for (int i = 0; i < subItems.size(rt); ++i) {
|
|
187
197
|
std::shared_ptr<ShadowNodeBinding> child =
|
|
188
198
|
subItems.getValueAtIndex(rt, i)
|
|
189
199
|
.getObject(rt)
|
|
190
200
|
.getHostObject<ShadowNodeBinding>(rt);
|
|
191
|
-
|
|
192
|
-
newChildren->push_back(clonedChild);
|
|
193
|
-
child->sn_ = clonedChild;
|
|
201
|
+
newChildren->push_back(child->sn_);
|
|
194
202
|
child->parent_ = shared_from_this();
|
|
195
203
|
}
|
|
196
204
|
|
package/package.json
CHANGED