I want to update the state when the realm is changing. I did this, but it does not work. I see the update after I re-open the app


#1
constructor(props) {
    super(props);
    this.state = {
        bills: []
    };
    this.reloadData();
    realm.addListener('change', () => {
        this.reloadData();
    });
}
reloadData = () => {
    queryAllBills().then((Bills) => {
        this.setState({ bills: Bills });
    }).catch((error) => {
        this.setState({ bills: [] });
    });
    console.warn('reloaded');
}