Trying to convert an in-app webpage to React. The app webview automatically calls a Javascript function to pass an access token to the webpage. So is it possible to use the same existing function to pass the token variable and store it as a React prop?

HTML

```
<div id="app"></div>
<script>
    function setToken(token){
    //set token to App token prop
  }
</script>

```

JS

```
class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      token: "",
    }
  }

  render() {
    return (
      <div>
        <p>{this.state.token}</p>
      </div>
    );
  }
}

ReactDOM.render(<App />, document.querySelector("#app"))

```

<https://jsfiddle.net/wzovs2gy/>