Replies: 4 comments 14 replies
-
Can you show a reproduction of what have you tried? This clearly shows that it's not true. https://codesandbox.io/s/dreamy-johnson-vi0xu?file=/index.js |
Beta Was this translation helpful? Give feedback.
-
The first case will invalidate const Parent = observer(({ object }) => {
console.log("render Parent");
return <Child arr={object.arr}/>
})
const Child = observer(({ arr }) => {
console.log("render Child")
return <ul>{arr.map(el => <li>{el}</li>)}</ul>
}) With See https://mobx.js.org/understanding-reactivity.html#understanding-reactivity |
Beta Was this translation helpful? Give feedback.
-
The same can be achieved without decorators, just use makeObservable. See
the docs for more info. .
…On Mon, Feb 8, 2021 at 1:17 PM Roey ***@***.***> wrote:
That makes sense @mweststrate <https://github.com/mweststrate>... I'll
have to take that into account if I ever decide to leave decorators
behind...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2791 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBEAY7O3EGXEELUVMBLS57P5ZANCNFSM4XINKJFQ>
.
|
Beta Was this translation helpful? Give feedback.
-
thank you all guys for you time!! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
let's say i'm defining ObservableArray like this:
@observable
arr = [];in that case,
arr.replace(['a','b','c']);
seems to work exactly the same as
arr = ['a','b','c'];
Am I missing something? I was sure regular assignment would reset arr to native js array,
10x,
Roey
Beta Was this translation helpful? Give feedback.
All reactions