WKScriptMessageHandler won’t Listen to ‘onclick’ or ‘click’ event on a button element on a webpage. The web page is developed using Reactjs

I am using a WKWebView inside a UIViewController’s view to display a webpage hosted on a server using a url endpoint. The webpage uses Reactjs. That is all the information I have about the webpage. The code creates a webview and inserts the webview as subview of the controllers view.