I try to update the array of the state when the database is changing, but It not work in real time. I see the update when I re-open the app


I export from the schemas new Realm(databaseOptions)
databaseOption is an object with the schema array

export default class BillList extends React.Component {
constructor(props) {
this.state = {
bills: []
realm.addListener(‘change’,() => this.reloadData())

reloadData = () => {
    queryAllBills().then(bills => {
        this.setState({ bills });
    }).catch(error => {
        this.setState({ bills: [] });


What does queryAllBills do? Have you reviewed the notifications section of the documentation?


yes. I read the docs. queryAllBills return all objects of type bill from the database


Sure, but why is it a promise? The Realm API are synchronous, so it’s not clear to me what else is happening there for it to become a promise. If you can create a simple app that reproduces the behavior you’re seeing, that will probably help us resolve this quicker.