embark-area-51/test_apps/test_app/app/js/app.js

28 lines
669 B
JavaScript
Raw Normal View History

2018-01-17 18:16:43 +00:00
import { Component } from 'react';
import SimpleStorage from 'Embark/contracts/SimpleStorage';
window.SimpleStorage = SimpleStorage;
2018-01-17 18:16:43 +00:00
class App extends Component {
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">
<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;