setState call error

I’m in main
var app = new Framework7({...});
i’ve created a function under root methods… what is the correct way to call setState?
this. and app. produce an error

          firstname: user_info.firstname,
          lastname: user_info.lastname,
        }, () => {
          // DOM updated

thanks in advance

In router component:

Thanks for reply
probably i’m stupid… I don’t know

if I call self.$setState() into page component works fine
but If I call into a root method, setState give me error

loginUser: function(e, p){, 
      { resource: 'Login', email: e, password: p }, 
      function (data, status, xhr) {
        var resp = data.content.response;

        if(resp.status == "success"){
          var user_info =;
          /*Here I would call setState to update root data */
          app.dialog.alert('Login non riuscito');
      }, function (status, xhr) {
      }, 'json');

This is normal behavior

so… how can update root data (and DOM) from a root method? Is this operation not permitted?

Access root data from component: this.$ = 'new value';
DOM: $ - Dom7:

I do like this to setState from root methods.

in any_page.jsx

componentDidMount() {
    const self = this;
    this.$f7ready((f7) => {
      // Call F7 APIs here

in app.jsx root methods

methods: {
		const self = this;
	         isSignedIn: false,
	         userProfile: false,

Correct me if I’m doing any bad practice!
Happy Coding!