Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`Worklets.createSharedValue` can't set fields on an object value individually

Aperta
#182 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, react-native, typescript
Ambito
mobile-dev

Direzione di ricerca

The issue names sharedvalue-tests.ts and the failing get_set_object_value test; run it first and compare the behavior with the regression introduced by PR 178. Done means mutating sharedValue.value.a and .b updates the stored object and the test passes, while preserving whole-value assignment.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I can't create a shared value that contains an object and then update the object's fields later. The get_set_object_value test in sharedvalue-tests.ts describes exactly what I am trying to do, and the test seems to be failing in release 1.2.0.

  get_set_object_value: () => {
    const sharedValue = Worklets.createSharedValue({ a: 100, b: 200 });
    sharedValue.value.a = 50;
    sharedValue.value.b = 100;
    return ExpectValue(sharedValue.value, { a: 50, b: 100 });
  },

The test output is:

 LOG  Running "WorkletsExample" with {"rootTag":11}
 LOG  Starting test with index 1
 LOG  Running test: get_set_object_value
 LOG  Loading react-native-worklets-core...
 LOG  Worklets loaded successfully
 LOG  ExpectValue, resolved: {"a": 100, "b": 200}
 LOG  ExpectValue, failed: Expected {"a":50,"b":100}, got {"a":100,"b":200}.
 LOG  Test: get_set_object_value failed.

I can only update the entire sharedValue like so:

  sharedValue.value = {
    a: 50,
    b: 100,
  };

I believe this is a regression of https://github.com/margelo/react-native-worklets-core/pull/178.

Lingua principale
C++
Stelle
791
Fork
65
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di margelo/react-native-worklets-core

Tutte le issue di margelo/react-native-worklets-core

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.