diff --git a/docs/docs/core/useSharedValue.mdx b/docs/docs/core/useSharedValue.mdx index 11b1a30fe13..96b5cb34025 100644 --- a/docs/docs/core/useSharedValue.mdx +++ b/docs/docs/core/useSharedValue.mdx @@ -88,6 +88,22 @@ function App() { +- When storing objects in a shared value, make sure to reassign an object instead of changing the properties individually. + + + +```javascript +function App() { + const sv = useSharedValue({ x: 0, y: 0 }); + + sv.value.x = 50; // Reanimated loses reactivity 🚨 + + sv.value = { x: 50, y: 50 }; // ✅ +} +``` + + + ## Platform compatibility