I’m working on a React Native app that loads the example.com in a webview. I was wondering if it’s safe to use postMessage to pass username and password to React Native from the React Native webview. Do you think it’s okay or it's not safe?
This is the web app(example.com) sending username and password to React Native

And this is React Native <WebView onMessage={m => this._onMessage(m)} /> to receive that username and password to Authenticate user.

Seems like it will work but not sure if it’s safe. If not, is there a way to authenticate user in React Native from React Native webview?