Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
React Native mobx: Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed

I'm using mobx as state management for my react-native app, I'm modifying a simple array of ids like this:

let copyy = userStore.unreadChatIds;
copyy.push(e.message.chat_id);
userStore.setUnreadChatIds(copyy);

However I'm getting this mobx warning, I don't know why I'm getting it since I'm using makeAutoObservable in my mobx store!

[MobX] Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: UserStore@1.unreadChatIds

My store

export class UserStore
{
    constructor()
    {
        makeAutoObservable(this);
        
unreadChatIds=[];

setUnreadChatIds(payload)
    {
        this.unreadChatIds = payload;
    }
}

Why am I getting this error and how can I solve it? afaik if using makeAutoObservable and use my setter method as action I'm not changing mobx state directly.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda