Skip to content

Instantly share code, notes, and snippets.

@Davisonpro
Last active October 22, 2019 11:38
Show Gist options
  • Save Davisonpro/a77506e154b61f93d80ed84e47ccf97a to your computer and use it in GitHub Desktop.
Save Davisonpro/a77506e154b61f93d80ed84e47ccf97a to your computer and use it in GitHub Desktop.
App.js file
import React, { Component, Fragment } from 'react';
import { render } from 'react-dom';
import { asyncComponent } from 'react-async-component';
/** We are importing our index.php my app Vairaible */
import myApp from 'myApp';
class Myapp extends Component {
render() {
const { user : { name, email }, logged } = myApp;
return (
<Fragment>
<div className="dashboard">
{logged &&
<h2 className="status">Logged In</h2>
}
<h1 className="name"> {name}</h1>
<p className="email">{email}</p>
<p>API host variable {__API_HOST__}</p>
</div>
</Fragment>
)
}
}
render(<Myapp/>, document.getElementById('app'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment