You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Qwik, when spreading an object ({...state.helloProps}) into a component's props, the UI does not update when the object properties change. The workaround requires forcing updates by using a unique key (e.g., JSON.stringify(state.helloProps)) to ensure the component re-renders.
This issue occurs because Qwik does not track object property changes inside the spread operator unless the reference itself changes.
Which component is affected?
Qwik React
Describe the bug
In Qwik, when spreading an object
({...state.helloProps}
) into a component's props, the UI does not update when the object properties change. The workaround requires forcing updates by using a uniquekey
(e.g.,JSON.stringify(state.helloProps)
) to ensure the component re-renders.This issue occurs because Qwik does not track object property changes inside the spread operator unless the reference itself changes.
Reproduction
https://qwik.dev/examples/introduction/hello-world/#f=7VZNS8NAEL33VwxFaAJhpRU8rEm9ePKgB%2F9AJZtKaLHiFwnL%2FnffzG7SJo3FSwTBU0OTTd6beTPvHYpmcTGomqT13JP6mXimHmzW0U9ICpbWu921bqKAO5IVJ4ElnsFOopwXLs7IWYU%2FXXou9yG1yaTtqcG2eo8qtLFj9xWfiK%2BaN1fkfibwkEjEDLKWd2ThWKCF4RMeDgvtiE1CNzWWbpm35qJDMRjwniTHKN8GvvJssR00pfIrI5FNeainvGM%2BEEYEj9pDkHIgd0jMOctsVHwmVGyFRTT0MLgUWyVvix1E4cNci6IJPZawP9FWTbP5S0WoZmkICzvfzBL4jTEgqmm%2BSJAwXp%2FKZ02X5NySgsZC52BMQn4Y9jiffoMzPhpKfcGtUqr%2FcaYd1D8igEj0WJj4EIrXaB%2BQNGJERJJJVpuiXtHtw%2F0dCsI6Ldf16SrhQGa7B34dOiYVGQI5jocfg%2BHxQj3fjUIfjb%2F4d6W%2F6kpf
Steps to reproduce
state.helloProps.foo
.Hello
receives props:spread
case does not update.spread (deopted)
case works because of explicit access to the object.with key JSON.stringify
case works because it forces re-render.explicit prop
case works correctly.System Info
Additional Information
Expected Behavior:
When spreading
state.helloProps
into<Hello {...state.helloProps} />
, the component should update as soon asstate.helloProps.foo
changes.The text was updated successfully, but these errors were encountered: