@neo-one/simulation-react
Version:
NEO•ONE Simulation - Bootstrap a decentralized app with NEO•ONE and React.
33 lines (24 loc) • 573 B
JavaScript
import React, { Component } from 'react';
import Main from './Main';
import { getClient, setupClient, getContracts } from './client';
const client = getClient();
export default class App extends Component {
static childContextTypes = {
client: () => null,
contracts: () => null,
};
getChildContext() {
return { client, contracts: this.state.contracts };
}
componentWillMount() {
this.setState({
contracts: getContracts(client),
});
}
componentDidMount() {
setupClient(client);
}
render() {
return <Main />;
}
}