Replies: 1 comment
-
ConversationItem does not seem marked as observer
…On Tue, Dec 20, 2022 at 6:43 PM Tobjoern ***@***.***> wrote:
I'm currently struggling to get mobx to react to a nested change in an
array.
You can find the repro here:
https://github.com/Tobjoern/mobx-reactivity-issue.
In my store, I have:
`export interface ConversationMessage {
content: string
id: string
}
export interface Conversation {
messages: ConversationMessage[]
user: string
}
conversations: Conversation[] = []
`
And mutate them via:
sendMessage(msg: string) { this.conversations[0].messages.push({ content:
msg, id: Math.random().toString() }) }
However, the 'ConversationItem' component does not react to the change at
all, it doesn't display the latest message, or even the message count.
Your help is appreciated!
—
Reply to this email directly, view it on GitHub
<#3591>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBHVR4IISALPB3YMGUDWOHV4PANCNFSM6AAAAAATEYG2MI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently struggling to get mobx to react to a nested change in an array.
You can find the repro here: https://github.com/Tobjoern/mobx-reactivity-issue.
In my store, I have:
`export interface ConversationMessage {
content: string
id: string
}
export interface Conversation {
messages: ConversationMessage[]
user: string
}
conversations: Conversation[] = []
`
And mutate them via:
sendMessage(msg: string) { this.conversations[0].messages.push({ content: msg, id: Math.random().toString() }) }
However, the 'ConversationItem' component does not react to the change at all, it doesn't display the latest message, or even the message count.
Your help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions