@leonsilicon/react-native-wishlist 0.0.3 → 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
- auto clonedChild = ShadowNodeCopyMachine::copyShadowSubtree(child->sn_);
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
 
@@ -217,8 +217,8 @@ void MGViewportCarerImpl::updateWindow() {
217
217
 
218
218
  std::vector<WishItem> itemsToRemove;
219
219
 
220
- // remove above
221
- while (true) {
220
+ // remove above — keep at least one item so window_ is never empty
221
+ while (window_.size() > 1) {
222
222
  WishItem item = window_.front();
223
223
  float bottom = item.offset + item.height;
224
224
  if (bottom <= topEdge) {
@@ -231,8 +231,8 @@ void MGViewportCarerImpl::updateWindow() {
231
231
  }
232
232
  }
233
233
 
234
- // remove below
235
- while (true) {
234
+ // remove below — keep at least one item so window_ is never empty
235
+ while (window_.size() > 1) {
236
236
  WishItem item = window_.back();
237
237
  if (item.offset >= bottomEdge) {
238
238
  window_.pop_back();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonsilicon/react-native-wishlist",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "The fastest List component for React Native updated to work with Expo 55",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",