score:3

Accepted answer

You could define the click handler function somewhere outside the config variable, and it should have access to everything outside the scope of the event.

myRerenderFunction(e) { /* do something */ } // define function here...

var config = {
      ...
          events: {
              click: myRerenderFunction // ...and it's accessible since they're defined in the same scope
          }
    };

Or you could just put the rerendering itself outside the click handler.

myRerenderFunction(e) { /* do something */ } // This is now a closure...

var config = {
      ...
          events: {
              click: function(e) {
                  /* Do something with the event */
                  myRerenderFunction(e); // ...which means you can access it from inside the click handler function
              }
          }
    };

Or you could just store the current this as a closure.

var whateverScopeThisIs = this;

var config = {
      ...
          events: {
              click: function(e) {
                  /* Do something with the event */
                  whateverScopeThisIs.doSomething(e);
              }
          }
    };

You've got plenty of options, something along those lines should work.

score:0

Try to use

events: {
   click: function (event) {
       window.ReactNativeWebView.postMessage(event)
   }
}

Related Query

More Query from same tag