Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#182 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp, react-native, typescript
Área
mobile-dev

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C++
Estrellas
791
Forks
65
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de margelo/react-native-worklets-core

Todos los issues de margelo/react-native-worklets-core

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.