Hi, im trying to bulk update using this
it goes ok, but when i change pages to any page who’s reading data i get this error
Error: Exception in HostFunction: Accessing object of type RebanhoSchema which has been invalidated or deleted
This error is located at:
in TouchableComponent (created by Select)
in Select (created by GeralFaz)
My Schemas are
‘’'export const Fazenda = {
name: “Farm”,
primaryKey: “_id”,
properties: {
_id: "string",
nomefaz: "string",
proprietario: "string",
tipoprod: "string",
createdAt: "date",
rebanhos: "RebanhoSchema[]",
},
};
export const RebanhoSchema = {
name: “RebanhoSchema”,
primaryKey: “_id”,
properties: {
_id: "string",
nomeReb: "string",
createdAt: "date",
vacas: "VacasSchema[]",
gastos: "GastosSchema[]",
assignee: {
type: "linkingObjects",
objectType: "Farm",
property: "rebanhos",
},
},
};
export const LeiteSchema = {
name: “LeiteSchema”,
primaryKey: “_id”,
properties: {
_id: "string",
precoL: "float",
prodL: "float",
description: "string",
createdAt: "date",
assignee: {
type: "linkingObjects",
objectType: "VacasSchema",
property: "receitas",
},
},
};
export const VacasSchema = {
name: “VacasSchema”,
primaryKey: “_id”,
properties: {
_id: "string",
nomeVaca: "string",
nascimentoVaca: "string",
brincoVaca: "string",
descVaca: "string",
createdAt: "date",
genero: "float",
receitas: "LeiteSchema[]",
gastosV: "float?",
assignee: {
type: "linkingObjects",
objectType: "RebanhoSchema",
property: "vacas",
},
},
};
export const GastosSchema = {
name: “GastosSchema”,
primaryKey: “_id”,
properties: {
_id: "string",
tipoAlim: "string?",
qtdAli: "float?",
valorAli: "float?",
consumoAli: "float?",
assignee: {
type: "linkingObjects",
objectType: "RebanhoSchema",
property: "gastos",
},
},
};’’’
Im trying to update the “VacasSchema” gastosV: , when app crashes i start it again and it goes allright the update was done and i can read data with no problem, but if i do the bulk update again and change page it crashes, im new with Realm, React Native and JS, i would really appreciate some help, thks!