2018-01-17 18:16:43 +00:00
|
|
|
import { Component } from 'react';
|
2018-02-14 12:01:33 +00:00
|
|
|
import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
|
|
|
window.SimpleStorage = SimpleStorage;
|
2018-01-17 18:16:43 +00:00
|
|
|
|
|
|
|
class App extends Component {
|
2018-02-14 12:01:33 +00:00
|
|
|
action() {
|
|
|
|
console.log("calling...")
|
|
|
|
SimpleStorage.methods.get().call(function(err, value) {
|
|
|
|
alert(value);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-01-17 18:16:43 +00:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="App">
|
|
|
|
<header className="App-header">
|
2018-02-14 12:01:33 +00:00
|
|
|
<h1 className="App-title" onClick={() => this.action() }>Welcome to React</h1>
|
2018-01-17 18:16:43 +00:00
|
|
|
</header>
|
|
|
|
<p className="App-intro">
|
|
|
|
To get started, edit <code>src/App.js</code> and save to reload.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|